diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index e79829c..bb3bdd0 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -1,4 +1,4 @@ -name: Deploy to dev-m1sk9-s1 +name: Deploy on: push: @@ -19,7 +19,7 @@ jobs: oauth-secret: ${{ secrets.TAILSCALE_OAUTH_SECRET }} tags: tag:ci - - name: Deploy compose to dev-m1sk9-s1 + - name: Deploy compose uses: appleboy/ssh-action@v1.2.0 with: host: ${{ secrets.SSH_HOST }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..573cc5a --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,46 @@ +name: Test + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + test-tailscale: + name: Test Tailscale connectivity + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Tailscale + uses: tailscale/github-action@v2 + with: + oauth-client-id: ${{ secrets.TAILSCALE_OAUTH_CLIENT_ID }} + oauth-secret: ${{ secrets.TAILSCALE_OAUTH_SECRET }} + tags: tag:ci + + - name: Test Tailscale connectivity + run: | + tailscale ping --verbose --timeout 10s --c 5 --until-direct=false dev-m1sk9-s1 + + test-compose: + name: Test compose files + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Testing compose files + run: | + for dir in $(find . -name 'compose.yaml' -exec dirname {} \;) + do + echo "Testing docker compose in $dir" + cd $dir + touch .env + docker compose config + cd - + done