-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (38 loc) · 1.2 KB
/
push-image.yaml
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
# Adapted from:
# https://dev.to/willvelida/pushing-container-images-to-github-container-registry-with-github-actions-1m6b
name: Deploy Images to GHCR
env:
ORG: 'pangeo-forge'
TAG: 'test'
on:
# push:
# branches:
# - main
# workflow_dispatch:
pull_request:
jobs:
push-store-image:
runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: './Store'
steps:
- uses: actions/checkout@v4
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# TODO: export tag
- name: 'Build Inventory Image'
run: |
docker build . --tag ghcr.io/${{ env.ORG }}/deploy-recipe-action:${{ env.TAG }}
docker push ghcr.io/${{ env.ORG }}/deploy-recipe-action:${{ env.TAG }}
- name: 'Prune docker (for testing pull time)' # TODO: remove
run: |
docker rmi -f $(docker images -aq)
docker system prune -f
- name: 'Pull Image (as test)' # TODO: remove
run: |
docker pull ghcr.io/${{ env.ORG }}/deploy-recipe-action:${{ env.TAG }}