Merge pull request #1357 from LeChatErrant/dependabot/npm_and_yarn/ty… #878
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 docker image | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*' | |
paths: | |
- Dockerfile | |
- .dockerignore | |
- package.json | |
- package-lock.json | |
- prisma/** | |
- src/** | |
- tsconfig.json | |
- .github/workflows/build_docker_image.yml | |
jobs: | |
build-docker-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Compute metadata for Docker image | |
id: metadata | |
uses: docker/metadata-action@v3 | |
with: | |
images: ghcr.io/${{ github.repository }} | |
tags: | | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=ref,event=branch,suffix=-latest | |
type=sha,format=long,prefix=commit-,enable=${{ github.ref_type == 'branch' }} | |
- name: Login to docker registry | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
registry: ghcr.io | |
- name: Build and push the Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
context: . | |
tags: ${{ steps.metadata.outputs.tags }} | |
labels: ${{ steps.metadata.outputs.labels }} |