Merge pull request #46 from navicore/renovate/docker-build-push-actio… #71
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: Continuous Integration | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Prepare | |
id: prepare | |
run: | | |
TAG=${GITHUB_REF##*/} | |
echo ::set-output name=tag_name::${TAG} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login do docker.io | |
if: startsWith(github.ref, 'refs/tags/') | |
run: docker login -u navicore -p ${{ secrets.DOCKER_TOKEN }} | |
- name: build and publish image | |
if: startsWith(github.ref, 'refs/tags/') | |
id: docker_build | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ startsWith(github.ref, 'refs/tags/') }} | |
tags: | | |
navicore/teams-notification-resource:${{ steps.prepare.outputs.tag_name }} | |
navicore/teams-notification-resource:latest |