diff --git a/.github/actions/docker-publish/action.yaml b/.github/actions/docker-publish/action.yaml index a710bdc..4dd6077 100644 --- a/.github/actions/docker-publish/action.yaml +++ b/.github/actions/docker-publish/action.yaml @@ -1,4 +1,5 @@ name: Build & Push Docker +description: Build a Dockerfile and publish to the registry inputs: compose-version: @@ -45,11 +46,12 @@ runs: using: composite steps: - name: Log in to the ghcr.io registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ${{ inputs.registry }} username: ${{ inputs.username }} password: ${{ inputs.password }} + logout: false - name: Docker meta id: meta @@ -63,10 +65,10 @@ runs: type=semver,pattern={{raw}} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Build and push the image to ghcr.io - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 id: publish with: context: ${{ inputs.context }} diff --git a/.github/workflows/docker_publish.yaml b/.github/workflows/docker_publish.yaml index b0af135..f7d7fc5 100644 --- a/.github/workflows/docker_publish.yaml +++ b/.github/workflows/docker_publish.yaml @@ -2,13 +2,16 @@ name: Build and publish Docker image on: push: - branches: - - main + branches: [main] pull_request: types: [opened, synchronize] release: types: [published] +permissions: + contents: read + packages: write + concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true @@ -22,13 +25,13 @@ jobs: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build and push Fuel Core NATS image uses: ./.github/actions/docker-publish id: publish with: username: ${{ github.repository_owner }} - password: ${{ secrets.REPO_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} image: ghcr.io/fuellabs/fuel-core-nats dockerfile: docker/fuel-core-nats.Dockerfile diff --git a/.github/workflows/helm_publish.yaml b/.github/workflows/helm_publish.yaml index 65e8597..f9e74cc 100644 --- a/.github/workflows/helm_publish.yaml +++ b/.github/workflows/helm_publish.yaml @@ -21,7 +21,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Package and Push Charts uses: bsord/helm-push@v4.1.0 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0a14bf1..17a8669 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -71,7 +71,7 @@ jobs: run: ls -R artifacts - name: Cache Artifacts - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: artifacts key: ${{ runner.os }}-artifacts-${{ github.sha }} @@ -95,10 +95,10 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Restore Artifacts Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: artifacts key: ${{ runner.os }}-artifacts-${{ github.sha }} @@ -116,49 +116,3 @@ jobs: with: publish-delay: 60000 registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - publish-docker-image: - runs-on: buildjet-4vcpu-ubuntu-2204 - permissions: - contents: read - actions: write - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v3 - with: - images: | - ghcr.io/fuellabs/fuel-core-nats - tags: | - type=sha - type=ref,event=branch - type=ref,event=tag - type=semver,pattern={{raw}} - type=raw,value=sha-{{sha}}-{{date 'YYYYMMDDhhmmss'}} - flavor: | - latest=${{ github.ref == 'refs/heads/master' }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to the ghcr.io registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.REPO_TOKEN }} - - - name: Build and push the image to ghcr.io - uses: docker/build-push-action@v6 - with: - context: . - platforms: linux/arm64 - file: docker/fuel-core-nats.Dockerfile - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=ghcr.io/fuellabs/fuel-core-nats-cache:latest - cache-to: type=registry,ref=ghcr.io/fuellabs/fuel-core-nats-cache:latest,mode=max diff --git a/.gitignore b/.gitignore index 16b395a..bcfae2e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ .cov lcov.info .env -node_modules/ pnpm-lock.yaml +node_modules/ ./package.json tmp