Skip to content

Merge branch 'master' of github.com:cycle-five/cracktunes #28

Merge branch 'master' of github.com:cycle-five/cracktunes

Merge branch 'master' of github.com:cycle-five/cracktunes #28

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_call:
env:
IMAGE_NAME: ${{ github.repository }}
jobs:
push:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
-
name: Repository Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Install sqlx-cli
run: cargo install sqlx-cli --no-default-features --features postgres,sqlite
-
name: Cache
uses: Swatinem/rust-cache@v1
-
name: Migrate database
env:
DATABASE_URL: sqlite://./data/crackedmusic.db
run: |
sqlx database create
sqlx migrate run --source migrations/
cargo sqlx prepare
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v4
with:
push: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}
tags: ${{ env.IMAGE_NAME }}