Bump github.com/go-sql-driver/mysql from 1.7.1 to 1.8.1 #179
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: docker | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Get latest tag | |
run: | | |
git fetch --tags | |
echo "current_tag=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV | |
echo "latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_ENV | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build only | |
id: docker_build_only | |
uses: docker/build-push-action@v2 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
push: false | |
tags: madflojo/tarmac:${{ github.sha }} | |
- name: Login to DockerHub | |
id: docker_login | |
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push (main) | |
id: docker_build | |
if: github.ref == 'refs/heads/main' | |
uses: docker/build-push-action@v2 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name == 'push' && 'true' || 'false' }} | |
tags: madflojo/tarmac:unstable | |
- name: Build and push (tag) | |
id: docker_build_tag | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: docker/build-push-action@v2 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name == 'push' && 'true' || 'false' }} | |
# tag with the git tag v* | |
tags: | | |
madflojo/tarmac:${{ github.ref_name }} | |
${{ env.latest_tag == env.current_tag && 'madflojo/tarmac:latest' }} |