diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d6641cc..0d45d10 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,28 +4,37 @@ on: - 'main' tags: - '*' -name: docker-publish-tags + +name: Publish Docker image + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} jobs: - docker: + build-and-push-image: runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - uses: actions/checkout@v2 - - uses: docker/login-action@v1 + - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 # v1.10.0 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - uses: docker/metadata-action@v3 + - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 id: meta with: - images: willnorris/imageproxy + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - uses: docker/build-push-action@v1 + - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: context: . push: true - tags: ${{ steps.meta.output.tags }} - labels: ${{ steps.meta.output.labels }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}