Skip to content

Commit

Permalink
update gh actions docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
aeifn committed Nov 17, 2021
1 parent 80af359 commit 1fc3e3c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
tags:
- 'v*'
workflow_dispatch:

env:
REGISTRY: ghcr.io

jobs:
build-and-push-app:
runs-on: ubuntu-latest
Expand All @@ -16,28 +20,24 @@ jobs:

- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
uses: docker/metadata-action@v3
with:
images: pastvu/fileserver
tag-semver: |
{{version}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
images: ${{ env.REGISTRY }}/pastvu/fileserver

- name: Login to Docker Hub
- name: Login to ghcr.io
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
push: true

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

0 comments on commit 1fc3e3c

Please sign in to comment.