forked from bubuntux/nordvpn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Julio Gutierrez
committed
Mar 11, 2023
1 parent
1f64566
commit b0a12aa
Showing
1 changed file
with
27 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,61 @@ | ||
name: deploy | ||
on: | ||
push: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get branch name | ||
id: git | ||
run: | | ||
NAME=$(echo ${GITHUB_REF} | sed -e "s/.*\///g") | ||
echo name=${NAME} ref=${GITHUB_REF} | ||
echo "::set-output name=name::${NAME}" | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: amd64,arm64,arm,386 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1.10.0 | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.CR_PAT }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
images: | | ||
${{ github.repository }} | ||
ghcr.io/${{ github.repository }} | ||
flavor: | | ||
latest=false | ||
tags: | | ||
${{ github.repository }}:${{ steps.git.outputs.name }} | ||
ghcr.io/${{ github.repository }}:${{ steps.git.outputs.name }} | ||
type=ref,event=branch | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
- name: Push latest | ||
uses: docker/build-push-action@v2 | ||
if: steps.git.outputs.name == 'master' | ||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: | | ||
${{ github.repository }}:latest | ||
ghcr.io/${{ github.repository }}:latest | ||
tags: ${{ steps.meta.outputs.tags }} | ||
|
||
- name: Update repo description | ||
uses: peter-evans/dockerhub-description@v2 | ||
if: steps.git.outputs.name == 'master' | ||
uses: peter-evans/dockerhub-description@v3 | ||
if: github.ref_name == 'master' | ||
with: | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
repository: ${{ github.repository }} | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
repository: ${{ github.repository }} |