Merge pull request #31 from ash0ne/beta #58
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
name: Build and Package Docker PDF Server | |
on: | |
push: | |
branches: | |
- main | |
- beta | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Semantic Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
npm install -g semantic-release @semantic-release/commit-analyzer @semantic-release/npm @semantic-release/github @semantic-release/changelog @semantic-release/git @semantic-release/release-notes-generator | |
npx semantic-release | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set version | |
id: set_version | |
run: | | |
VERSION=$(node -p "require('./package.json').version") | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
- name: Build and push Docker images | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
a0ne/docker-pdf-server:latest | |
a0ne/docker-pdf-server:${{ steps.set_version.outputs.version }} | |
ghcr.io/${{ github.repository_owner }}/docker-pdf-server:latest | |
ghcr.io/${{ github.repository_owner }}/docker-pdf-server:${{ steps.set_version.outputs.version }} | |
- name: Logout from GitHub Container Registry | |
run: docker logout ghcr.io | |
- name: Logout from Docker Hub | |
run: docker logout a0ne |