Skip to content

Commit 6380a6a

Browse files
committed
Publish images on demand with GitHub Actions
1 parent 6686715 commit 6380a6a

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: Publish
3+
on:
4+
workflow_dispatch:
5+
push:
6+
7+
jobs:
8+
images:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
packages: write
13+
attestations: write
14+
id-token: write
15+
steps:
16+
- uses: actions/checkout@v7
17+
- uses: actions/setup-node@v7
18+
- run: bin/setup
19+
- name: Build the Dev Container
20+
run: >-
21+
devcontainer build
22+
--image-name ghcr.io/thoughtbot/devcontainers/images/debian
23+
--workspace-folder images/debian
24+
- name: Start the container
25+
run: >-
26+
devcontainer up
27+
--id-label test-container=debian
28+
--workspace-folder "images/debian"
29+
- name: Run the tests in the container
30+
run: >-
31+
devcontainer exec
32+
--id-label test-container=debian
33+
--workspace-folder images/debian
34+
/bin/sh test/test.sh
35+
- name: Log in to ghcr
36+
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f
37+
with:
38+
registry: ghcr.io
39+
username: ${{ github.actor }}
40+
password: ${{ secrets.GITHUB_TOKEN }}
41+
- name: Tag the image with the current date
42+
run: >-
43+
docker tag
44+
ghcr.io/thoughtbot/devcontainers/images/debian:latest
45+
ghcr.io/thoughtbot/devcontainers/images/debian:$(date +"%Y%m%d")
46+
- name: Push image with current date tag
47+
run: docker push ghcr.io/thoughtbot/devcontainers/images/debian:$(date +"%Y%m%d")
48+
- name: Push image with latest tag
49+
run: docker push ghcr.io/thoughtbot/devcontainers/images/debian:latest

0 commit comments

Comments
 (0)