Skip to content

chore: release 0.0.4 (#43) #105

chore: release 0.0.4 (#43)

chore: release 0.0.4 (#43) #105

Workflow file for this run

name: Build and upload Docker image
on:
release:
types: [published]
push:
branches: [dev]
tags:
- "*.*.*"
env:
REGISTRY: ghcr.io
BASE_NAME: graphops/listener-radio
jobs:
build-linux:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
DATABASE_URL: postgresql://postgres:password@localhost:5432/postgres
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
${{ env.REGISTRY }}/${{ env.BASE_NAME }}
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=semver,pattern={{major}}
type=sha
latest:main
latest:dev
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_TOKEN }}
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Setup database
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
run: cargo install sqlx-cli --no-default-features --features native-tls,postgres
- name: Database create
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
run: sqlx database create
- name: Database migrate
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
run: sqlx migrate run
- name: Build and push
uses: docker/build-push-action@v4
with:
context: ./
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
dockerfile: Dockerfile