-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 1.98 KB
/
build-web-terminal.yaml
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
62
63
64
65
66
67
68
69
70
71
name: Build
on: # yamllint disable-line rule:truthy
schedule:
- cron: '5 4 * * 6'
push:
branches: ["main"]
# paths:
# - components/containers/web-terminal/**
# - .github/workflows/**
pull_request:
branches: ["main"]
# paths:
# - components/containers/web-terminal/**
# - .github/workflows/**
concurrency:
group: web-terminal-tooling
jobs:
build-container:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
git-sha: ${{ steps.git-sha.outputs.sha }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set output for Git short SHA
id: git-sha
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Cache tooling binaries
uses: actions/cache@v4
id: cache-tooling-binaries
with:
path: container/tools-x86_64.tgz
key: ${{ hashFiles('container/bin.sh', 'container/download_tools.sh') }}
- name: Download tooling binaries
if: steps.cache-tooling-binaries.outputs.cache-hit != 'true'
run: |
cd container
./download_tools.sh
- name: Log into GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push images to ghcr.io
uses: docker/build-push-action@v5
with:
context: container
file: container/Containerfile
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/${{ github.repository_owner }}/web-terminal-tooling:git-${{ steps.git-sha.outputs.sha }}
ghcr.io/${{ github.repository_owner }}/web-terminal-tooling:latest
labels: org.opencontainers.image.version=${{ steps.git-sha.outputs.sha }}