From b92b4727e6d468239ea21048a7af3ac1d7db1aac Mon Sep 17 00:00:00 2001 From: Adrian Kosmaczewski Date: Tue, 28 Mar 2023 08:28:04 +0200 Subject: [PATCH] Moved container to ghcr.io --- .github/workflows/container.yaml | 51 ++++++++++++++++++++++++++++++++ README.adoc | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/container.yaml diff --git a/.github/workflows/container.yaml b/.github/workflows/container.yaml new file mode 100644 index 0000000..6a26faa --- /dev/null +++ b/.github/workflows/container.yaml @@ -0,0 +1,51 @@ +# 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. + +# GitHub recommends pinning actions to a commit SHA. +# To get a newer version, you will need to update the SHA. +# You can also reference a tag or branch, but the action may change without warning. + +name: Create and publish a Docker image + +on: + push: + branches: ['main'] + tags: ['*'] + +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@v3 + + - name: Log in to the Container registry + uses: docker/login-action@219c305e1ce92a755f3aa4ba17387c95df31e987 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/README.adoc b/README.adoc index 04cc29a..c92f225 100644 --- a/README.adoc +++ b/README.adoc @@ -10,5 +10,5 @@ NOTE: The version number of the Docker image matches the version of Afterwriting To create the PDF version of a Fountain screenplay, use the following command: -`docker run --rm --user "$(id -u)" --volume "$(pwd)":/image vshn/afterwriting:1.17.3 --source /image/presentation.fountain --pdf /image/test.pdf` +`docker run --rm --user "$(id -u)" --volume "$(pwd)":/image ghcr.io/vshn/afterwriting:1.17.3 --source /image/presentation.fountain --pdf /image/test.pdf`