update reuse header #12
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: CI/CD | |
on: | |
push: | |
env: | |
PROJECT_NAME: tickets-dashboard | |
DOCKER_IMAGE: ghcr.io/${{ github.repository }} | |
DOCKER_TAG: ${{ github.sha }} | |
SERVER_PORT: 1021 | |
jobs: | |
deploy-test: | |
runs-on: ubuntu-22.04 | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout source code | |
uses: noi-techpark/github-actions/checkout@v2 | |
- name: Create .env file | |
uses: noi-techpark/github-actions/env-file@v2 | |
env: | |
X_COMPOSE_PROJECT_NAME: ${{ env.PROJECT_NAME }} | |
X_DOCKER_IMAGE: ${{ env.DOCKER_IMAGE }} | |
X_DOCKER_TAG: ${{ env.DOCKER_TAG }} | |
X_SERVER_PORT: ${{ env.SERVER_PORT }} | |
X_USERNAME_RT: dashboard | |
X_BASE_URL: https://issues.opendatahub.com/REST/1.0/ | |
- name: Build and push | |
uses: noi-techpark/github-actions/docker-build-and-push@v2 | |
with: | |
docker-username: ${{ github.actor }} | |
docker-password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Decrypt secret config file | |
run: base64 -d ./app/config.yaml.enc | gpg --batch -d -o- --passphrase ${{secrets.VAULT_PASSPHRASE}} - > config.yaml | |
- name: Deploy application | |
uses: noi-techpark/github-actions/docker-deploy@v2 | |
with: | |
hosts: 'test' | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
docker-username: 'noi-techpark-bot' | |
docker-password: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
project-name: ${{ env.PROJECT_NAME }} | |
deploy-prod: | |
runs-on: ubuntu-22.04 | |
if: github.ref == 'refs/heads/prod' | |
steps: | |
- name: Checkout source code | |
uses: noi-techpark/github-actions/checkout@v2 | |
- name: Create .env file | |
uses: noi-techpark/github-actions/env-file@v2 | |
env: | |
X_COMPOSE_PROJECT_NAME: ${{ env.PROJECT_NAME }} | |
X_DOCKER_IMAGE: ${{ env.DOCKER_IMAGE }} | |
X_DOCKER_TAG: ${{ env.DOCKER_TAG }} | |
X_SERVER_PORT: ${{ env.SERVER_PORT }} | |
- name: Build and push | |
uses: noi-techpark/github-actions/docker-build-and-push@v2 | |
with: | |
docker-username: ${{ github.actor }} | |
docker-password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Decrypt secret config file | |
run: base64 -d ./app/config.yaml.enc | gpg --batch -d -o- --passphrase ${{secrets.VAULT_PASSPHRASE}} - > config.yaml | |
- name: Deploy application | |
uses: noi-techpark/github-actions/docker-deploy@v2 | |
with: | |
hosts: 'prod' | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
docker-username: 'noi-techpark-bot' | |
docker-password: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
project-name: ${{ env.PROJECT_NAME }} |