Skip to content

Commit 51a7597

Browse files
author
Andrei Jiroh Eugenio Halili
committed
ci(github-actions): update workflows and stuff
And again, just copied from the starter-pack, while keeping the repository name btw. Signed-off-by: Andrei Jiroh Eugenio Halili <[email protected]>
1 parent bcf1cfc commit 51a7597

File tree

2 files changed

+28
-25
lines changed

2 files changed

+28
-25
lines changed

.github/workflows/docker-cicd-develop.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@ on:
1616
- ".trigger-rebuild"
1717
- ".dockerignore"
1818
- "toolkits/packages/scripts/**"
19+
- "toolkits/packages/dotbashrcdir/**"
1920
pull_request:
2021
branches: [ main ]
2122
workflow_dispatch:
23+
inputs:
24+
force_push:
25+
description: Leave it blank to only run test build, otherwise set to true.
26+
required: false
2227

2328
jobs:
2429
test-image-builds:
@@ -30,14 +35,16 @@ jobs:
3035

3136
- name: Install Dive
3237
run: |
33-
wget https://github.com/wagoodman/dive/releases/download/v0.10.0/dive_0.10.0_linux_amd64.deb -O $HOME/work/_temp/dive_linux_amd64.deb
34-
sudo apt install $HOME/work/_temp/dive_linux_amd64.deb
38+
wget https://github.com/wagoodman/dive/releases/download/v0.10.0/dive_0.10.0_linux_amd64.deb -O /tmp/dive_linux_amd64.deb
39+
sudo apt install /tmp/dive_linux_amd64.deb
3540
3641
- name: Build and check for wasted space
42+
env:
43+
DOCKER_BUILDKIT: 1
3744
run: |
45+
set -eux
3846
docker build --tag registry.repohub.dev/${{env.namespace}}/${{env.repository}} .
39-
# may not work if it's first test build
40-
dive registry.repohub.dev/${{env.namespace}}/${{env.repository}} #--source ghcr.io/${{env.namespace}}/${{env.repository}}
47+
CI=true dive registry.repohub.dev/${{env.namespace}}/${{env.repository}}
4148
4249
publish-to-dev:
4350
name: Publish as canary
@@ -62,11 +69,6 @@ jobs:
6269
flavor: |
6370
latest=false
6471
65-
- name: Print out values
66-
env:
67-
METADATA_OUTPUTS: ${{ toJSON(steps.meta.outputs) }}
68-
run: "echo -e $METADATA_OUTPUTS"
69-
7072
# Setup QEMU for multiarch builds
7173
- name: Set up QEMU
7274
uses: docker/setup-qemu-action@v1
@@ -87,7 +89,8 @@ jobs:
8789
uses: docker/login-action@v1
8890
with:
8991
registry: ghcr.io
90-
# change the username into yours if not using our bot
92+
# change the username into yours if not using our bot, might use
93+
# an env or secrets way in the future
9194
username: RecapTimeBot
9295
# you need to manually add our bot with write access if you use our PAT
9396
password: ${{ secrets.GH_SERVICE_ACCOUNT_API_KEY }}
@@ -109,4 +112,5 @@ jobs:
109112
tags: ${{ steps.meta.outputs.tags }}
110113
labels: ${{ steps.meta.outputs.labels }}
111114
context: .
112-
platforms: linux/amd64,linux/arm64
115+
# arm64 can sometimes experience weird GnuTLS errors
116+
platforms: linux/amd64

.github/workflows/docker-cicd-release.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Docker CI (image releaser)"
1+
name: "Docker CI (image release)"
22

33
env:
44
# Change this to match GITHUB_REPOSITORY or any name you want.
@@ -11,6 +11,8 @@ env:
1111

1212
on:
1313
release:
14+
# After tagging a release from the command line, you need to create a new release
15+
# for the releaser CI to trigger.
1416
type: [published]
1517

1618
jobs:
@@ -31,17 +33,12 @@ jobs:
3133
${{ env.namespace_dockerhub }}/${{ env.repository }}
3234
quay.io/${{ env.namespace }}/${{ env.repository }}
3335
ghcr.io/${{ env.namespace }}/${{ env.repository }}
36+
# For prereleases, the tag name should be have a suffix, like -betaXX
3437
tags: |
3538
type=semver,pattern={{version}}
36-
type=raw,value=beta
3739
flavor: |
3840
latest=false
3941
40-
- name: Print out values
41-
env:
42-
METADATA_OUTPUTS: ${{ toJSON(steps.meta.outputs) }}
43-
run: "echo '$METADATA_OUTPUTS'"
44-
4542
# Setup QEMU for multiarch builds
4643
- name: Set up QEMU
4744
uses: docker/setup-qemu-action@v1
@@ -62,7 +59,8 @@ jobs:
6259
uses: docker/login-action@v1
6360
with:
6461
registry: ghcr.io
65-
# change the username into yours if not using our bot
62+
# change the username into yours if not using our bot, might use
63+
# an env or secrets way in the future
6664
username: RecapTimeBot
6765
# you need to manually add our bot with write access if you use our PAT
6866
password: ${{ secrets.GH_SERVICE_ACCOUNT_API_KEY }}
@@ -84,6 +82,7 @@ jobs:
8482
tags: ${{ steps.meta.outputs.tags }}
8583
labels: ${{ steps.meta.outputs.labels }}
8684
context: .
85+
# arm64 can sometimes experience weird GnuTLS errors
8786
platforms: linux/amd64
8887
publish-to-stable:
8988
name: Release to stable
@@ -103,14 +102,13 @@ jobs:
103102
ghcr.io/${{ env.namespace }}/${{ env.repository }}
104103
tags: |
105104
type=semver,pattern={{version}}
105+
# v0.2.x and above
106+
type=semver,pattern={{major}}.{{minor}}
107+
# disabled if major zero
108+
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
106109
flavor: |
107110
latest=true
108111
109-
- name: Print out values
110-
env:
111-
METADATA_OUTPUTS: ${{ toJSON(steps.meta.outputs) }}
112-
run: "echo '$METADATA_OUTPUTS'"
113-
114112
# Setup QEMU for multiarch builds
115113
- name: Set up QEMU
116114
uses: docker/setup-qemu-action@v1
@@ -153,4 +151,5 @@ jobs:
153151
tags: ${{ steps.meta.outputs.tags }}
154152
labels: ${{ steps.meta.outputs.labels }}
155153
context: .
156-
platforms: linux/amd64
154+
# arm64 can sometimes experience weird GnuTLS errors
155+
platforms: linux/amd64

0 commit comments

Comments
 (0)