Merge pull request #22 from n1eko/add-more-data #33
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: Node.js CD | |
on: | |
push: | |
branches: [ main ] | |
env: | |
PORT: ${{secrets.API_PORT}} | |
TS3_HOST: ${{secrets.TS3_HOST}} | |
TS3_SERVER_PORT: ${{secrets.TS3_PORT}} | |
TS3_QUERY_PORT: ${{secrets.TS3_QUERY_PORT}} | |
TS3_USER: ${{secrets.TS3_USER}} | |
TS3_PASS: ${{secrets.TS3_PASS}} | |
TS3_NICK: ${{secrets.TS3_NICK}} | |
jobs: | |
build: | |
runs-on: [self-hosted, ARM64] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: chrnorm/deployment-action@releases/v1 | |
name: Create GitHub deployment | |
id: deployment | |
with: | |
token: "${{ github.token }}" | |
target_url: https://tsapi.n1eko.com/ | |
environment: production | |
- run: docker build . -t tsapi:0.0.1 | |
- name: Create env file | |
run: | | |
touch .env | |
echo PORT=${{ secrets.API_PORT }} >> .env | |
echo TS3_HOST=${{ secrets.TS3_HOST }} >> .env | |
echo TS3_SERVER_PORT=${{ secrets.TS3_PORT }} >> .env | |
echo TS3_QUERY_PORT=${{ secrets.TS3_QUERY_PORT }} >> .env | |
echo TS3_USER=${{ secrets.TS3_USER }} >> .env | |
echo TS3_PASS=${{ secrets.TS3_PASS }} >> .env | |
echo TS3_NICK=${{ secrets.TS3_NICK }} >> .env | |
- run: docker-compose up -d | |
- name: Update deployment status (success) | |
if: success() | |
uses: chrnorm/deployment-status@releases/v1 | |
with: | |
token: "${{ github.token }}" | |
target_url: https://tsapi.n1eko.com/ | |
state: "success" | |
deployment_id: ${{ steps.deployment.outputs.deployment_id }} | |
- name: Update deployment status (failure) | |
if: failure() | |
uses: chrnorm/deployment-status@releases/v1 | |
with: | |
token: "${{ github.token }}" | |
target_url: https://tsapi.n1eko.com/ | |
state: "failure" | |
deployment_id: ${{ steps.deployment.outputs.deployment_id }} |