Prebuild image #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 }} |