diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6959a8a..01d7b95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,34 +1,29 @@ name: CI - on: push: branches: - main + tags: + - 'v*' pull_request: branches: - main - jobs: test-and-build: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - - name: Set up Node.js uses: actions/setup-node@v3 with: node-version: '18' - - name: Install dependencies run: npm install - - name: Run tests run: npm run test - - name: Build project run: npm run build - e2e-test: name: 'Playwright Tests' runs-on: ubuntu-latest @@ -55,33 +50,30 @@ jobs: needs: - test-and-build - e2e-test - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') steps: - name: Checkout code uses: actions/checkout@v3 - - name: Set up QEMU uses: docker/setup-qemu-action@v2 with: platforms: 'arm64,amd64' - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Login to DockerHub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Extract metadata for Docker id: meta uses: docker/metadata-action@v4 with: images: iib0011/omni-tools tags: | - type=raw,value=latest - + type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} + type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} + type=semver,pattern={{major}}.{{minor}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} - name: Build and push Docker image uses: docker/build-push-action@v4 with: @@ -101,18 +93,14 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - - name: Set up Node.js uses: actions/setup-node@v3 with: node-version: '18' - - name: Install dependencies run: npm install - - name: Build project run: npm run build - - name: Deploy to Netlify uses: nwtgck/actions-netlify@v1.2 with: diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 0e86a3c..8b52a7f 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,10 +4,10 @@