Add a github action to publish new image after a tag is pushed #1
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 docker image | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build: | |
name: Clone, Build, Publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: | | |
scrolltech/rollupscan-monitor | |
tags: | | |
type=semver,pattern={{version}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Dockerhub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to Github | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.PAT_OWNER }} | |
password: ${{ secrets.PAT_TOKEN }} | |
- name: Build image | |
id: build | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
context: "slack-bots/rollupscan_monitor/" | |
tags: ${{ steps.meta.outputs.tags }} |