Merge pull request #953 from rsteube/dependabot/github_actions/action… #296
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: Go | |
on: | |
push: | |
branches: | |
- 'master' | |
tags: | |
- 'v*' | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build the Docker image | |
run: | | |
tag=latest | |
[[ "$GITHUB_REF" =~ ^refs/tags/ ]] && tag="${GITHUB_REF/refs\/tags\//}" | |
docker build . --tag "ghcr.io/rsteube/carapace:${tag}" | |
docker push "ghcr.io/rsteube/carapace:${tag}" |