diff --git a/.github/workflows/ci_cd.yaml b/.github/workflows/ci_cd.yaml index ac90a37..77b7552 100644 --- a/.github/workflows/ci_cd.yaml +++ b/.github/workflows/ci_cd.yaml @@ -1,6 +1,6 @@ name: build, test and deploy -on: [push, pull_request] +on: [ push, pull_request ] jobs: test: @@ -8,45 +8,45 @@ jobs: if: "!contains(github.event.head_commit.message, 'skip-ci')" runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Install yarn - uses: actions/setup-node@v3 - with: - node-version: 16 - - name: Install dependencies and build web app - run: make build-web - - name: Install golang - uses: actions/setup-go@v4 - with: - go-version: 1.21.3 # Same version as set in Dockerfile + - name: Checkout code + uses: actions/checkout@v4 + - name: Install yarn + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Install dependencies and build web app + run: make build-web + - name: Install golang + uses: actions/setup-go@v5 + with: + go-version: 1.22.4 # Same version as set in Dockerfile - # - name: Run linters - # uses: golangci/golangci-lint-action@v2 + - name: Run linter + uses: golangci/golangci-lint-action@v6 - - name: Run tests - run: make coverage - - name: Prepare coverage report - uses: jandelgado/gcov2lcov-action@v1.0.9 - - name: Send coverage report - uses: coverallsapp/github-action@v2.2.3 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: coverage.lcov + - name: Run tests + run: make coverage + - name: Prepare coverage report + uses: jandelgado/gcov2lcov-action@v1.0.9 + - name: Send coverage report + uses: coverallsapp/github-action@v2.3.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: coverage.lcov deploy: - # Only run this in case building and testing succeeded and the event is a push to master + # Only run this in case building and testing succeeded, and the event is a push to master if: "${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}" needs: test runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 # do a full, so not a shallow, clone - - name: Push to dokku - uses: dokku/github-action@v1.4.0 - with: - git_push_flags: "--force" - git_remote_url: "ssh://dokku@vps.fdlo.ch:22/cassette" - ssh_private_key: ${{ secrets.DOKKU_SSH_PRIVATE_KEY }} + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # do a full, so not a shallow, clone + - name: Push to dokku + uses: dokku/github-action@v1.4.0 + with: + git_push_flags: "--force" + git_remote_url: "ssh://dokku@vps.fdlo.ch:22/cassette" + ssh_private_key: ${{ secrets.DOKKU_SSH_PRIVATE_KEY }}