Skip to content

Commit

Permalink
new workflow to create faas-supervisor-kit image
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioLangaritaBenitez committed Aug 19, 2024
1 parent 1b8b086 commit 18c329a
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,55 @@ jobs:
supervisor-alpine-arm64/supervisor-alpine-arm64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

push_faas_supervisor_kit:
if: github.event_name == 'release'
needs:
- release-assets
env:
REGISTRY: ghcr.io
IMAGE_NAME: grycap/faas-supervisor-kit
name: Push Docker image to Docker Hub
runs-on: ubuntu-20.04
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}


- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
context: .
file: ./extra/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
FAAS_VERSION=${{ steps.meta.outputs.version }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
9 changes: 9 additions & 0 deletions faassupervisor-kit/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ubuntu:20.04

ARG FAAS_VERSION

RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install -y wget unzip
RUN wget -O supervisor.zip https://github.com/grycap/faas-supervisor/releases/download/$FAAS_VERSION/supervisor.zip
RUN unzip supervisor.zip
RUN rm supervisor.zip

0 comments on commit 18c329a

Please sign in to comment.