diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 175ddb35..82ffa25a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ name: Build on: pull_request: - branches: ["master"] + branches: ["main"] jobs: build: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 9c903f82..00000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Deploy to GitHub Pages - -on: - push: - branches: - - master - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: {} - -jobs: - build: - name: Build - if: github.repository == 'ton-blockchain/verifier' - runs-on: ubuntu-latest - - permissions: - contents: read - - steps: - - name: Fetch Sources - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - - name: Enable Corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 - with: - node-version: 22.x - cache: "npm" - - - name: Install dependencies - run: npm ci - - - name: Build project - run: npm run build - - - name: Upload GitHub Pages artifact - uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 - with: - path: dist - - deploy: - name: Deploy - if: github.repository == 'ton-blockchain/verifier' - needs: [build] - runs-on: ubuntu-latest - - permissions: - pages: write # to deploy to Pages - id-token: write # to verify the deployment originates from an appropriate source - - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..604e1168 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,44 @@ +name: Build Docker Image + +on: + push: + branches: + - main + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=sha,format=short + type=ref,event=branch + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..8f0ce4a7 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,27 @@ +# This is a basic workflow to help you get started with Actions + +name: Build and Deploy + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v2.3.1 + - name: install dependencies + run: npm ci + - name: Build + run: CI=false npm run build + env: + VITE_APP_GA: ${{ secrets.GOOGLE_ANALYTICS }} + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@4.1.4 + with: + branch: gh-pages # The branch the action should deploy to. + folder: dist # The folder the action should deploy.