Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update action #1

Merged
merged 4 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -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}
3 changes: 2 additions & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

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

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: "S3 Sync"
name: "Sync to S3"
description: "Sync a directory to an AWS S3 repository"
author: jakejarvis
author: Cyso Cloud
runs:
using: docker
image: Dockerfile
image: registry.fuga.io/public/s3-sync:1.0.0
branding:
icon: refresh-cw
color: green
14 changes: 7 additions & 7 deletions Dockerfile → docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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.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"

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

# 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}

Expand Down
File renamed without changes.