personal-site/.github/workflows/main.yml

61 lines
1.6 KiB
YAML
Raw Normal View History

2021-06-30 19:30:01 +00:00
name: Create and publish a Docker image
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
push:
2021-06-30 19:31:40 +00:00
branches: ['main']
2022-08-01 02:51:23 +00:00
repository_dispatch:
2021-06-30 19:30:01 +00:00
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
2022-07-06 06:13:41 +00:00
- name: Setup Python
uses: actions/setup-python@v4.0.0
2022-07-06 06:15:36 +00:00
with:
2022-12-15 09:58:23 +00:00
python-version: 3.12.0-alpha.3
2021-06-30 19:30:01 +00:00
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2022-07-25 05:40:52 +00:00
- name: NWS Pull New Image
2022-07-28 23:45:48 +00:00
uses: nickorlow/nws-pull-new-image@v0.9.2
2022-07-25 05:40:52 +00:00
with:
# Your NWS Deploy Key
deploy-key: ${{ secrets.NWS_DEPLOY_KEY }}
# The application id to get a new image for
2022-07-28 23:45:48 +00:00
application-id: ${{ secrets.NWS_APPLICATION_ID }}