Skip to content

V0.3.0 rc.1

V0.3.0 rc.1 #34

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: Dockerhub
on:
# push:
# tags: ['v*.*.*']
# branches: [master]
workflow_dispatch:
push:
branches:
- 'master'
tags: ['v*.*.*']
pull_request:
# branches:
# - 'master'
workflow_call:
env:
IMAGE_NAME: cyclefive/cracktunes
jobs:
push:
#if: github.event_name == 'push' && github.ref == 'refs/heads/master'
if: github.event_name == 'pull_request' || github.event_name == 'push' || (github.event_name == 'workflow_call' && github.event.inputs.trigger == 'build')
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
-
name: Repository Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# -
# name: Cache
# uses: Swatinem/rust-cache@v2
# -
# name: Install sqlx-cli
# run: cargo install sqlx-cli --no-default-features --features postgres
# -
# uses: ikalnytskyi/action-setup-postgres@v4
# with:
# username: postgres
# password: mysecretpassword
# database: postgres
# port: 5432
# id: postgres
# -
# name: Migrate database
# env:
# DATABASE_URL: ${{ steps.postgres.outputs.connection-uri }}
# PG_USER: postgres
# PG_PASSWORD: mysecretpassword
# run: |
# sqlx database create
# sqlx migrate run --source migrations/
# cargo sqlx prepare --workspace
-
name: Extract Git Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: cyclefive/cracktunes
-
# name: Build and push
# uses: docker/build-push-action@v5
# with:
# push: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}
# tags: ${{ env.IMAGE_NAME }}
name: Build & Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
# push: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}