Workflow file for this run
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
name: Build and publish web docker image | |
on: | |
release: | |
types: | |
- created | |
env: | |
IMAGE_NAME: notify-web | |
IMAGE_TAG: ${{ github.event.release.tag_name }} # eg. v0.0.1 | |
GH_USERNAME: m-mattia-m | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build image | |
run: docker build . --file ./web/.docker/Dockerfile --tag $IMAGE_NAME --label $IMAGE_TAG | |
- name: Log in to registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
- name: Add tag to image | |
run: docker tag $IMAGE_NAME ghcr.io/$GH_USERNAME/$IMAGE_NAME:$IMAGE_TAG | |
- name: Push image to container-registry | |
run: docker push ghcr.io/$GH_USERNAME/$IMAGE_NAME:$IMAGE_TAG |