Workflow file for this run
This file contains hidden or 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: Publish New Release To NPM And Image To Docker Hub | |
| on: | |
| release: | |
| # This specifies that the build will be triggered when we publish a release | |
| types: [published] | |
| permissions: | |
| id-token: write | |
| contents: write | |
| jobs: | |
| publish: | |
| name: Publish New Release To NPM And Image To Docker Hub | |
| runs-on: ubuntu-latest | |
| env: | |
| IMAGE_NAME: tardisdev/tardis-machine | |
| NPM_CONFIG_MIN_RELEASE_AGE: 0 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ github.event.release.target_commitish }} | |
| - name: Use Node.js v25.8.2 | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 25.8.2 | |
| registry-url: https://registry.npmjs.org/ | |
| - name: Install Dependencies And Compile TS | |
| run: npm ci --ignore-scripts | |
| - name: Verify Registry Signatures | |
| run: npm audit signatures | |
| - name: Audit Production Dependencies | |
| run: npm audit --omit=dev --audit-level=critical | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name "GitHub Release Bot" | |
| git config --global user.email "deploy@tardis.dev" | |
| - name: Update package version | |
| run: npm version ${{ github.event.release.tag_name }} | |
| - name: Run Tests | |
| run: npm run test | |
| - name: Publish Package | |
| run: npm publish | |
| - name: Push Version Changes To GitHub | |
| env: | |
| VERSION_BRANCH: ${{ github.event.repository.default_branch }} | |
| run: git push origin "HEAD:${VERSION_BRANCH}" | |
| - name: Set Up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| - name: Set Up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login To Docker Hub | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build And Push Docker Image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| build-args: VERSION_ARG=${{ github.event.release.tag_name }} | |
| tags: | | |
| ${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }} | |
| ${{ env.IMAGE_NAME }}:latest | |
| - name: Logout From Docker Hub | |
| run: docker logout | |
| if: ${{ always() }} | |
| continue-on-error: true |