Merge pull request #101 from B-urb/renovate/all-minor #27
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: Deploy Release | |
on: | |
push: | |
branches: | |
- 'v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+' | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+' | |
env: | |
CI: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: development | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '21' | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v3 | |
with: | |
gradle-version: 8.6 | |
- name: Install dependencies | |
working-directory: frontend | |
run: npm ci | |
- name: Build | |
working-directory: frontend | |
run: npm run build | |
- name: Copy Frontend distributable | |
run: cp -r frontend/dist src/main/resources | |
- name: Run build with Gradle Wrapper | |
run: ./gradlew buildFatJar | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: production-artifacts | |
path: | | |
build/ | |
build-docker: | |
needs: build | |
runs-on: ubuntu-latest | |
if: ${{ github.ref }} != 'master' && ${{ github.ref }} != 'development' | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: production-artifacts | |
- name: Set up Docker Build | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Registry | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: ${{ secrets.DOCKERHUB_USERNAME }}/cardmaster:${{ env.BRANCH_NAME }} | |
platforms: linux/amd64,linux/arm64 | |
pulumi-deploy: | |
needs: build-docker | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- run: npm install | |
working-directory: deploy | |
- name: Decode kubeconfig | |
run: | | |
mkdir -p $HOME/.kube | |
echo "${{ secrets.KUBE_CONFIG }}" | base64 -d > $HOME/.kube/config | |
cat $HOME/.kube/config | |
shell: bash | |
- name: Deploy with Pulumi | |
uses: pulumi/actions@v5 | |
with: | |
command: up | |
stack-name: dev | |
work-dir: deploy | |
env: | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
registryImage: ${{ secrets.DOCKERHUB_USERNAME }}/cardmaster | |
imageTag: ${{ github.head_ref || github.ref_name }} |