Skip to content

CD Pipeline

CD Pipeline #16

Workflow file for this run

name: CD Pipeline
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the Repository
uses: actions/checkout@v3
- name: Append Database URL
run: echo -e '\n\nspring.datasource.url=${{ secrets.DATABASE_URL }}' >> src/main/resources/application.properties
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/adamscript/tomateto-api
tags: |
type=semver,pattern={{version}}
flavor: |
latest=true
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker Image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}