Skip to content

Bugfix release

Bugfix release #32

name: build-latest-release
on:
workflow_dispatch: {}
schedule:
- cron: '0 0 * * 0'
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Set latest release tag
if: github.event_name != 'release'
run: |
echo "RELEASE_TAG=$(curl https://api.github.com/repos/crinis/sourcebans-docker/releases -s | jq -r ".[].tag_name")" >> $GITHUB_ENV
-
name: Set current release tag
if: github.event_name == 'release'
run: |
echo "RELEASE_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
-
name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ env.RELEASE_TAG }}
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/sourcebans:${{ env.RELEASE_TAG }}, ${{ secrets.DOCKERHUB_USERNAME }}/sourcebans:latest, ${{ secrets.DOCKERHUB_USERNAME }}/sourcebans:${{ github.run_id }}