Build and Deploy #62
Workflow file for this run
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 Deploy | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.12.1] | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3.0.2 | |
with: | |
persist-credentials: false | |
- name: 'Get Previous tag' | |
id: previoustag | |
uses: "WyriHaximus/github-action-get-previous-tag@v1" | |
with: | |
fallback: "latest" # Optional fallback tag to use when no tag can be found | |
- name: Install and Build (using Node.js ${{ matrix.node-version }}) 🔧 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: npm ci | |
- run: npm run test | |
- run: npm run build | |
- name: Deploy to gh-pages 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4.3.3 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: gh-pages # The branch the action should deploy to. | |
FOLDER: dist # The folder the action should deploy. | |
CLEAN: true # Automatically remove deleted files from the deploy branch | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Nexus | |
uses: docker/login-action@v2 | |
with: | |
registry: nexus.terrestris.de | |
username: ${{ secrets.NEXUS_USERNAME }} | |
password: ${{ secrets.NEXUS_TOKEN }} | |
- name: Build and Push to Nexus 🚀 | |
id: docker_build | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
context: . | |
tags: | | |
nexus.terrestris.de/mholthausen/worldmap_3d:latest | |
nexus.terrestris.de/mholthausen/worldmap_3d:${{ steps.previoustag.outputs.tag }} |