-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (50 loc) · 1.4 KB
/
build.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
61
name: Docker Image CI
on:
push:
branches:
- main
paths:
- 'versions.env'
env:
REGISTRY: ghcr.io
IMAGE_NAME: k9s-web
REPO_OWNER: lordmathis
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
permissions:
packages: write
contents: write
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rymndhng/release-on-push-action@master
id: release
with:
bump_version_scheme: minor
use_github_release_notes: true
- name: Set build args env
run: |
set -a
source versions.env
set +a
echo TTYD_VERSION=$TTYD_VERSION >>${GITHUB_ENV}
echo K9S_VERSION=$K9S_VERSION >>${GITHUB_ENV}
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
${{ env.REGISTRY }}/${{ env.REPO_OWNER }}/${{ env.IMAGE_NAME }}:${{ steps.release.outputs.tag_name }}
${{ env.REGISTRY }}/${{ env.REPO_OWNER }}/${{ env.IMAGE_NAME }}:latest
build-args: |
TTYD_VERSION=${{ env.TTYD_VERSION }}
K9S_VERSION=${{ env.K9S_VERSION }}