From 40398350b6f5ab55016cc08ba1766ebb5d33b44a Mon Sep 17 00:00:00 2001 From: Sam Toxopeus Date: Fri, 7 Feb 2025 16:36:22 +0100 Subject: [PATCH 1/4] Update action --- Dockerfile | 12 ++++++------ LICENSE.md | 3 ++- action.yml | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2aba1f5..9227f0a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,17 @@ -FROM mirror.gcr.io/python:3.8-alpine +FROM mirror.gcr.io/python:3.13-alpine LABEL "com.github.actions.name"="S3 Sync" LABEL "com.github.actions.description"="Sync a directory to an AWS S3 repository" LABEL "com.github.actions.icon"="refresh-cw" LABEL "com.github.actions.color"="green" -LABEL version="0.5.1" -LABEL repository="https://github.com/jakejarvis/s3-sync-action" -LABEL homepage="https://jarv.is/" -LABEL maintainer="Jake Jarvis " +LABEL version="0.6.0" +LABEL repository="https://github.com/FugaCloud/s3-sync-action" +LABEL homepage="https://cyso.cloud/" +LABEL maintainer="Sam Toxopeus " # https://github.com/aws/aws-cli/blob/master/CHANGELOG.rst -ENV AWSCLI_VERSION='1.18.14' +ENV AWSCLI_VERSION='1.37.15' RUN pip install --quiet --no-cache-dir awscli==${AWSCLI_VERSION} diff --git a/LICENSE.md b/LICENSE.md index 369b968..b228f42 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,7 @@ MIT License -Copyright (c) 2019-present Jake Jarvis +Copyright (c) 2025 Cyso Cloud +Copyright (c) 2019 Jake Jarvis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/action.yml b/action.yml index a7d6253..c972c5b 100644 --- a/action.yml +++ b/action.yml @@ -1,6 +1,6 @@ name: "S3 Sync" description: "Sync a directory to an AWS S3 repository" -author: jakejarvis +author: Cyso Cloud runs: using: docker image: Dockerfile From 1a825d4be7c877028973281214e4fae100d7a5a2 Mon Sep 17 00:00:00 2001 From: Sam Toxopeus Date: Fri, 7 Feb 2025 17:10:48 +0100 Subject: [PATCH 2/4] Prebuild docker container --- .github/workflows/build-image.yml | 89 +++++++++++++++++++++++++++ action.yml | 2 +- Dockerfile => docker/Dockerfile | 0 entrypoint.sh => docker/entrypoint.sh | 0 4 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-image.yml rename Dockerfile => docker/Dockerfile (100%) rename entrypoint.sh => docker/entrypoint.sh (100%) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml new file mode 100644 index 0000000..038c848 --- /dev/null +++ b/.github/workflows/build-image.yml @@ -0,0 +1,89 @@ +name: Publish Artifacts + +on: + push: + tags: [ '*.*.*' ] + +env: + REGISTRY: ${{ vars.FUGA_REGISTRY_FQDN }} + IMAGE_NAME: public/s3-sync + + +jobs: + build-image: + runs-on: actions-runners-machete + permissions: + contents: read + packages: write + id-token: write + + outputs: + version: ${{ steps.meta.outputs.version }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} # Required for pushing changes + + # Install the cosign tool except on PR + # https://github.com/sigstore/cosign-installer + - name: Install cosign + if: github.event_name != 'pull_request' + uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0 + with: + cosign-release: 'v2.2.4' + + # Set up BuildKit Docker container builder to be able to build + # multi-platform images and export cache + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ secrets.FUGA_REGISTRY_USERNAME }} + password: ${{ secrets.FUGA_REGISTRY_PASSWORD }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 + with: + context: ./docker + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=s3,blobs_prefix=cache/${{ github.repository }}/,manifests_prefix=cache/${{ github.repository }}/,use_path_style=true,endpoint_url=${{ vars.S3_CACHE_URL }},access_key_id=${{ vars.S3_CACHE_USER }},secret_access_key=${{ secrets.S3_CACHE_PW }},region=${{ vars.S3_CACHE_REGION }},bucket=${{ vars.S3_CACHE_BUCKET }} + cache-to: type=s3,blobs_prefix=cache/${{ github.repository }}/,manifests_prefix=cache/${{ github.repository }}/,use_path_style=true,endpoint_url=${{ vars.S3_CACHE_URL }},access_key_id=${{ vars.S3_CACHE_USER }},secret_access_key=${{ secrets.S3_CACHE_PW }},region=${{ vars.S3_CACHE_REGION }},bucket=${{ vars.S3_CACHE_BUCKET }},mode=max + build-args: | + VERSION=${{ steps.meta.outputs.version || 'dev' }} + + # Sign the resulting Docker image digest except on PRs. + # This will only write to the public Rekor transparency log when the Docker + # repository is public to avoid leaking data. If you would like to publish + # transparency data even for private images, pass --force to cosign below. + # https://github.com/sigstore/cosign + - name: Sign the published Docker image + if: ${{ github.event_name != 'pull_request' }} + env: + # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable + TAGS: ${{ steps.meta.outputs.tags }} + DIGEST: ${{ steps.build-and-push.outputs.digest }} + # This step uses the identity token to provision an ephemeral certificate + # against the sigstore community Fulcio instance. + run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} \ No newline at end of file diff --git a/action.yml b/action.yml index c972c5b..7352dd3 100644 --- a/action.yml +++ b/action.yml @@ -3,7 +3,7 @@ description: "Sync a directory to an AWS S3 repository" author: Cyso Cloud runs: using: docker - image: Dockerfile + image: registry.fuga.io/public/s3-sync:0.6.0 branding: icon: refresh-cw color: green diff --git a/Dockerfile b/docker/Dockerfile similarity index 100% rename from Dockerfile rename to docker/Dockerfile diff --git a/entrypoint.sh b/docker/entrypoint.sh similarity index 100% rename from entrypoint.sh rename to docker/entrypoint.sh From bd40da02febf2555300c06232e5be6d35d1748f0 Mon Sep 17 00:00:00 2001 From: Sam Toxopeus Date: Fri, 7 Feb 2025 17:26:36 +0100 Subject: [PATCH 3/4] Update name --- action.yml | 2 +- docker/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 7352dd3..cff009c 100644 --- a/action.yml +++ b/action.yml @@ -1,4 +1,4 @@ -name: "S3 Sync" +name: "Sync to S3" description: "Sync a directory to an AWS S3 repository" author: Cyso Cloud runs: diff --git a/docker/Dockerfile b/docker/Dockerfile index 9227f0a..6a7dc53 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ FROM mirror.gcr.io/python:3.13-alpine -LABEL "com.github.actions.name"="S3 Sync" +LABEL "com.github.actions.name"="Sync to S3" LABEL "com.github.actions.description"="Sync a directory to an AWS S3 repository" LABEL "com.github.actions.icon"="refresh-cw" LABEL "com.github.actions.color"="green" From e0a4a215bb8b7f2b74373389e697d322c6d72900 Mon Sep 17 00:00:00 2001 From: Sam Toxopeus Date: Fri, 7 Feb 2025 17:27:23 +0100 Subject: [PATCH 4/4] Set version to 1.0.0 --- action.yml | 2 +- docker/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index cff009c..80f76c4 100644 --- a/action.yml +++ b/action.yml @@ -3,7 +3,7 @@ description: "Sync a directory to an AWS S3 repository" author: Cyso Cloud runs: using: docker - image: registry.fuga.io/public/s3-sync:0.6.0 + image: registry.fuga.io/public/s3-sync:1.0.0 branding: icon: refresh-cw color: green diff --git a/docker/Dockerfile b/docker/Dockerfile index 6a7dc53..9985b2b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -5,7 +5,7 @@ LABEL "com.github.actions.description"="Sync a directory to an AWS S3 repository LABEL "com.github.actions.icon"="refresh-cw" LABEL "com.github.actions.color"="green" -LABEL version="0.6.0" +LABEL version="1.0.0" LABEL repository="https://github.com/FugaCloud/s3-sync-action" LABEL homepage="https://cyso.cloud/" LABEL maintainer="Sam Toxopeus "