Skip to content

Commit

Permalink
Merge pull request #90 from cash-track/feature/tags
Browse files Browse the repository at this point in the history
Update workflow to run on selfhosted runner
  • Loading branch information
vokomarov authored Aug 14, 2022
2 parents a38b425 + cae2ec4 commit 9175a2f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .env.actions
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ JWT_REFRESH_TTL=604800
JWT_PUBLIC_KEY="{rsa-public-key}"
JWT_PRIVATE_KEY="{rsa-private-key}"

DB_HOST=0.0.0.0:33060
DB_HOST=database:3306
DB_NAME=cashtrack
DB_USER=root
DB_USER=cashtrack
DB_PASSWORD=secret

S3_REGION=us-east-1
Expand Down
26 changes: 18 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
security:
name: Security
runs-on: ubuntu-latest
runs-on: [self-hosted, Linux, x64]
steps:
- name: Checkout Repository
uses: actions/checkout@v2
Expand All @@ -25,13 +25,16 @@ jobs:

static-analysis:
name: Static Analysis
runs-on: ubuntu-latest
runs-on: [self-hosted, Linux, x64]
container: shivammathur/node:latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
runner: self-hosted
with:
php-version: '8.1'
extensions: zip, mbstring, pdo_mysql, mysqli
Expand All @@ -58,13 +61,16 @@ jobs:

coding-standards:
name: Coding Standards
runs-on: ubuntu-latest
runs-on: [self-hosted, Linux, x64]
container: shivammathur/node:latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
runner: self-hosted
with:
php-version: '8.1'
extensions: zip, mbstring, pdo_mysql, mysqli
Expand All @@ -91,20 +97,22 @@ jobs:

tests:
name: Tests
runs-on: ubuntu-latest
runs-on: [self-hosted, Linux, x64]
container: shivammathur/node:latest
permissions:
contents: read
packages: write

services:
mysql:
image: mysql:8.0
database:
image: cashtrack/mysql:latest
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: cashtrack
MYSQL_USER: cashtrack
MYSQL_PASSWORD: secret
ports:
- 33060:3306
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
Expand All @@ -113,6 +121,8 @@ jobs:

- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
runner: self-hosted
with:
php-version: '8.1'
coverage: pcov
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ env:
INFRA_REPO_REF: main
CLUSTER: k8s-cash-track
NAMESPACE: cash-track
KUBECTL_BIN: https://storage.googleapis.com/kubernetes-release/release/v1.23.9/bin/linux/amd64/kubectl

jobs:
build:
runs-on: ubuntu-latest
runs-on: [self-hosted, Linux, x64]
permissions:
contents: read
packages: write
Expand Down Expand Up @@ -55,7 +56,7 @@ jobs:

deploy:
needs: [ build ]
runs-on: ubuntu-latest
runs-on: [self-hosted, Linux, x64]
permissions:
contents: read
packages: write
Expand All @@ -73,6 +74,12 @@ jobs:
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}

- name: Install kubectl
run: |
curl -LO ${{ env.KUBECTL_BIN }}
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
- name: Configure kubectl
run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 ${{ env.CLUSTER }}

Expand Down

0 comments on commit 9175a2f

Please sign in to comment.