forked from verilog-to-routing/vtr-verilog-to-routing
-
Notifications
You must be signed in to change notification settings - Fork 12
61 lines (53 loc) · 1.78 KB
/
containers.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: Containers
on:
# We want to run the CI when anything is pushed to master.
# Since master is a protected branch this only happens when a PR is merged.
# This is a double check in case the PR was stale and had some issues.
push:
branches:
- master
paths-ignore: # Prevents from running if only docs are updated
- 'doc/**'
- '**/*README*'
- '**.md'
- '**.rst'
pull_request:
paths-ignore: # Prevents from running if only docs are updated
- 'doc/**'
- '**/*README*'
- '**.md'
- '**.rst'
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # weekly
# We want to cancel previous runs for a given PR or branch / ref if another CI
# run is requested.
# See: https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
Image:
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
steps:
- name: 🧰 Repository Checkout
uses: actions/checkout@v4
with:
submodules: 'true'
- name: 🔧 Generate image name
id: generate
run: |
REPO='${{ github.repository }}'
echo "image=ghcr.io/${REPO,,}/ubuntu/focal/build" >> $GITHUB_OUTPUT
- name: ⛴️ Build container image
run: docker build -t ${{ steps.generate.outputs.image }} -f Dockerfile .
- name: 🛰️ Push container image
if: github.event_name != 'pull_request'
uses: pyTooling/Actions/with-post-step@r0
with:
main: |
echo '${{ github.token }}' | docker login ghcr.io -u GitHub-Actions --password-stdin
docker push ${{ steps.generate.outputs.image }}
post: docker logout ghcr.io