diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 33ec639..930661a 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -1,9 +1,15 @@ name: Deployment pipeline +env: + SHOULD_DEPLOY: ${{ github.event_name == 'push' && !contains(join(github.event.commits.*.message), '#skip') }} + on: push: branches: - main + pull_request: + branches: [main] + types: [opened, synchronize] jobs: simple_deployment_pipeline: @@ -39,6 +45,20 @@ jobs: path: playwright-report/ retention-days: 30 - name: Deploy app + if: ${{ env.SHOULD_DEPLOY == 'true' }} run: flyctl deploy --remote-only env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} + tag_release: + if: ${{ github.event_name == 'push' && !contains(join(github.event.commits.*.message), '#skip') }} + needs: [simple_deployment_pipeline] + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: '0' + - name: Bump version and push tag + uses: anothrNick/github-tag-action@1.70.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DEFAULT_BUMP: patch diff --git a/src/app.js b/src/app.js index a9008e8..59a7a0c 100644 --- a/src/app.js +++ b/src/app.js @@ -39,8 +39,8 @@ app.patch('/api/anecdotes/:id', (req, res) => { res.json(anecdotes[anecdoteIndex]); }); -app.get('/version', (req, res) => { - res.send('2'); +app.get('/api/version', (req, res) => { + res.send('3'); }); app.get('*', (_req, res) => {