-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.54 KB
/
cd.yaml
File metadata and controls
59 lines (51 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Continuous Deployment
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
run-name: Deploy ${{ github.event.ref }}
jobs:
gen-release:
runs-on: ubuntu-latest
steps:
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}
excludeTypes: build,docs,other,style
excludeScopes: ci,cicd
- name: Create Release
uses: ncipollo/release-action@v1.14.0
with:
allowUpdates: true
draft: false
makeLatest: true
name: ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.changes }}
token: ${{ github.token }}
container:
runs-on: ubuntu-latest
needs: gen-release
steps:
- id: no-v
uses: actions/github-script@v7
with:
script: |
const tag = '${{ github.ref }}'.split('/')[2];
const noV = tag.replace(/^v/, '');
core.setOutput('no-v', noV)
- name: Checkout
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
push: true
tags: ghcr.io/timecopsync/project-api:${{ steps.no-v.outputs.no-v }},ghcr.io/timecopsync/project-api:latest