-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
95 additions
and
38 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: container-images | ||
|
||
on: | ||
push: | ||
branches: [master, next] | ||
# paths: [packages/service, "!**/*.md"] | ||
pull_request: | ||
branches: [master, next] | ||
# paths: [packages/service, "!**/*.md"] | ||
|
||
jobs: | ||
container-images: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14.x | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Login to Quay.io | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_ROBOT_TOKEN }} | ||
|
||
- name: Read container image tags | ||
id: image-tags | ||
run: | | ||
echo "VERSION=$(cat packages/service/package.json | jq .version -r)" >> $GITHUB_OUTPUT | ||
echo "BRANCH=$(echo "${{ github.head_ref || github.ref_name }}" | iconv -t ascii//TRANSLIT | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z)" >> $GITHUB_OUTPUT | ||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./packages/service | ||
tags: | ||
isneezy/pdf-generator:${{ steps.image-tags.outputs.VERSION }}, | ||
isneezy/pdf-generator:${{ steps.image-tags.outputs.BRANCH }}, | ||
isneezy/pdf-generator:latest, | ||
|
||
isneezy/pdf-generator-service:${{ steps.image-tags.outputs.VERSION }}, | ||
isneezy/pdf-generator-service:${{ steps.image-tags.outputs.BRANCH }}, | ||
isneezy/pdf-generator-service:latest, | ||
|
||
quay.io/isneezy/pdf-generator-service:${{ steps.image-tags.outputs.VERSION }}, | ||
quay.io/isneezy/pdf-generator-service:${{ steps.image-tags.outputs.BRANCH }}, | ||
quay.io/isneezy/pdf-generator-service:latest, | ||
push: ${{ (contains(github.ref, 'master') || contains(github.ref, 'next')) }} | ||
|
||
|
||
# build-docker-image: | ||
# # if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - name: build | ||
# run: docker build --cache-from isneezy/pdf-generator -t isneezy/pdf-generator . | ||
# - name: lanunch docker container | ||
# run: docker run --rm -p 3000:3000 --name=service -d isneezy/pdf-generator | ||
## - name: Test Generate Endpoint | ||
## run: | | ||
## curl -o test.pdf --location --request POST 'localhost:3000/generate' \ | ||
## --header 'Content-Type: application/json' \ | ||
## --data-raw '{ | ||
## "content": "<h2>Helo</h2>" | ||
## }' | ||
## stat test.pdf | ||
# - name: cleanup | ||
# run: docker rm -f service && docker image rm isneezy/pdf-generator:latest | ||
|
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
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
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