Skip to content

Commit 96fdab5

Browse files
authored
Merge pull request #1 from FugaCloud/refactor/upgrade-and-stuff
Update action
2 parents e668d3a + e0a4a21 commit 96fdab5

File tree

5 files changed

+101
-11
lines changed

5 files changed

+101
-11
lines changed

.github/workflows/build-image.yml

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Publish Artifacts
2+
3+
on:
4+
push:
5+
tags: [ '*.*.*' ]
6+
7+
env:
8+
REGISTRY: ${{ vars.FUGA_REGISTRY_FQDN }}
9+
IMAGE_NAME: public/s3-sync
10+
11+
12+
jobs:
13+
build-image:
14+
runs-on: actions-runners-machete
15+
permissions:
16+
contents: read
17+
packages: write
18+
id-token: write
19+
20+
outputs:
21+
version: ${{ steps.meta.outputs.version }}
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
with:
27+
token: ${{ secrets.GITHUB_TOKEN }} # Required for pushing changes
28+
29+
# Install the cosign tool except on PR
30+
# https://github.com/sigstore/cosign-installer
31+
- name: Install cosign
32+
if: github.event_name != 'pull_request'
33+
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0
34+
with:
35+
cosign-release: 'v2.2.4'
36+
37+
# Set up BuildKit Docker container builder to be able to build
38+
# multi-platform images and export cache
39+
# https://github.com/docker/setup-buildx-action
40+
- name: Set up Docker Buildx
41+
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
42+
43+
# Login against a Docker registry except on PR
44+
# https://github.com/docker/login-action
45+
- name: Log into registry ${{ env.REGISTRY }}
46+
if: github.event_name != 'pull_request'
47+
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
48+
with:
49+
registry: ${{ env.REGISTRY }}
50+
username: ${{ secrets.FUGA_REGISTRY_USERNAME }}
51+
password: ${{ secrets.FUGA_REGISTRY_PASSWORD }}
52+
53+
# Extract metadata (tags, labels) for Docker
54+
# https://github.com/docker/metadata-action
55+
- name: Extract Docker metadata
56+
id: meta
57+
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
58+
with:
59+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
60+
61+
# Build and push Docker image with Buildx (don't push on PR)
62+
# https://github.com/docker/build-push-action
63+
- name: Build and push Docker image
64+
id: build-and-push
65+
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
66+
with:
67+
context: ./docker
68+
push: ${{ github.event_name != 'pull_request' }}
69+
tags: ${{ steps.meta.outputs.tags }}
70+
labels: ${{ steps.meta.outputs.labels }}
71+
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 }}
72+
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
73+
build-args: |
74+
VERSION=${{ steps.meta.outputs.version || 'dev' }}
75+
76+
# Sign the resulting Docker image digest except on PRs.
77+
# This will only write to the public Rekor transparency log when the Docker
78+
# repository is public to avoid leaking data. If you would like to publish
79+
# transparency data even for private images, pass --force to cosign below.
80+
# https://github.com/sigstore/cosign
81+
- name: Sign the published Docker image
82+
if: ${{ github.event_name != 'pull_request' }}
83+
env:
84+
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
85+
TAGS: ${{ steps.meta.outputs.tags }}
86+
DIGEST: ${{ steps.build-and-push.outputs.digest }}
87+
# This step uses the identity token to provision an ephemeral certificate
88+
# against the sigstore community Fulcio instance.
89+
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

LICENSE.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
MIT License
22

3-
Copyright (c) 2019-present Jake Jarvis <[email protected]>
3+
Copyright (c) 2025 Cyso Cloud
4+
Copyright (c) 2019 Jake Jarvis <[email protected]>
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal

action.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: "S3 Sync"
1+
name: "Sync to S3"
22
description: "Sync a directory to an AWS S3 repository"
3-
author: jakejarvis
3+
author: Cyso Cloud
44
runs:
55
using: docker
6-
image: Dockerfile
6+
image: registry.fuga.io/public/s3-sync:1.0.0
77
branding:
88
icon: refresh-cw
99
color: green

Dockerfile docker/Dockerfile

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
FROM mirror.gcr.io/python:3.8-alpine
1+
FROM mirror.gcr.io/python:3.13-alpine
22

3-
LABEL "com.github.actions.name"="S3 Sync"
3+
LABEL "com.github.actions.name"="Sync to S3"
44
LABEL "com.github.actions.description"="Sync a directory to an AWS S3 repository"
55
LABEL "com.github.actions.icon"="refresh-cw"
66
LABEL "com.github.actions.color"="green"
77

8-
LABEL version="0.5.1"
9-
LABEL repository="https://github.com/jakejarvis/s3-sync-action"
10-
LABEL homepage="https://jarv.is/"
11-
LABEL maintainer="Jake Jarvis <[email protected]>"
8+
LABEL version="1.0.0"
9+
LABEL repository="https://github.com/FugaCloud/s3-sync-action"
10+
LABEL homepage="https://cyso.cloud/"
11+
LABEL maintainer="Sam Toxopeus <[email protected]>"
1212

1313
# https://github.com/aws/aws-cli/blob/master/CHANGELOG.rst
14-
ENV AWSCLI_VERSION='1.18.14'
14+
ENV AWSCLI_VERSION='1.37.15'
1515

1616
RUN pip install --quiet --no-cache-dir awscli==${AWSCLI_VERSION}
1717

entrypoint.sh docker/entrypoint.sh

File renamed without changes.

0 commit comments

Comments
 (0)