Skip to content

Commit 657ccd5

Browse files
committed
ci: add GitHub Actions workflow 'Containers'
Signed-off-by: Unai Martinez-Corral <[email protected]>
1 parent d9719cf commit 657ccd5

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/containers.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Containers
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
schedule:
8+
- cron: '0 0 * * 0' # weekly
9+
10+
jobs:
11+
12+
Image:
13+
runs-on: ubuntu-latest
14+
env:
15+
DOCKER_BUILDKIT: 1
16+
steps:
17+
18+
- name: 🧰 Repository Checkout
19+
uses: actions/checkout@v2
20+
21+
- name: 🔧 Generate image name
22+
id: generate
23+
run: |
24+
REPO='${{ github.repository }}'
25+
echo "::set-output name=image::ghcr.io/${REPO,,}/ubuntu/focal/build"
26+
27+
- name: ⛴️ Build container image
28+
run: docker build -t ${{ steps.generate.outputs.image }} -f Dockerfile .
29+
30+
- name: 🛰️ Push container image
31+
if: github.event_name != 'pull_request'
32+
uses: pyTooling/Actions/with-post-step@r0
33+
with:
34+
main: |
35+
echo '${{ github.token }}' | docker login ghcr.io -u GitHub-Actions --password-stdin
36+
docker push ${{ steps.generate.outputs.image }}
37+
post: docker logout ghcr.io

0 commit comments

Comments
 (0)