-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) 路 1.4 KB
/
ci.yml
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
60
name: build-n-push
on:
release:
types: [published]
workflow_dispatch:
env:
REGISTRY: ghcr.io/geekopsua
IMAGE_NAME: ${{ github.repository }}
defaults:
run:
shell: bash
working-directory: ./
jobs:
build:
name: Build and push Docker image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
# TODO: Try create changelog during pull request
# - name: Conventional Changelog Action
# uses: TriPSs/conventional-changelog-action@v3
# with:
# github-token: ${{ secrets.github_token }}
# https://github.com/marketplace/actions/docker-login
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ github.token }}
# Build and push Docker image
- name: Setup go-task
uses: pnorton5432/setup-task@v1
with:
task-version: 3.29.1
- name: Build Docker image
run: |
ls -lha . && pwd
echo "Build the image"
task build-docker Tag="${{ github.ref_name }}"
- name: Push Docker image
run: |
echo "Push the image"
task push-docker Tag="${{ github.ref_name }}"