-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (36 loc) · 1.16 KB
/
cd.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
name: CD
on:
workflow_call:
secrets:
GHCR_TOKEN:
required: true
TEST_SECRET:
required: true
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
build_and_push:
runs-on: ubuntu-latest
environment: Test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Write file
run: echo "${{ secrets.TEST_SECRET }}" > test.txt
- name: Build and export
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_SUMMARY: false
with:
tags: ghcr.io/decatur-robotics/gearbox:latest
outputs: type=docker,dest=/tmp/gearbox.tar
context: . # Needed for Docker to find files made during the workflow
- name: Load image
run: |
docker load --input /tmp/gearbox.tar
docker image ls -a
- name: Sign in to GHCR
run: echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u decatur-robotics --password-stdin
- name: Push to GHCR
run: docker push ghcr.io/decatur-robotics/gearbox:latest