Skip to content

Commit

Permalink
feat: add build and publish in registry in relaese job
Browse files Browse the repository at this point in the history
  • Loading branch information
dcristaldo committed Apr 15, 2024
1 parent 1aab272 commit 35d7533
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Release

on:
workflow_dispatch:
push:
branches:
- main
Expand All @@ -11,6 +12,7 @@ env:

permissions:
contents: write
packages: write

jobs:
bump_version:
Expand All @@ -21,14 +23,14 @@ jobs:
version: ${{ steps.cz.outputs.version }}
steps:
- name: Check out
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
token: "${{ secrets.ACCESS_TOKEN }}"
ref: "main"

- name: Set up Python
uses: actions/setup-python@v4.7.0
uses: actions/setup-python@v5.1.0
with:
python-version: 3.11

Expand Down Expand Up @@ -57,3 +59,21 @@ jobs:

- name: Print Version
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"

build:
runs-on: ubuntu-latest
steps:
- name: 🛎 Checkout
uses: actions/checkout@v4
- name: Set up buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr.io
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build and push
run: |
if [ -z "${{ needs.bump_version.outputs.version }}" ]; then
VERSION="latest"
else
VERSION="${{ steps.bump_version.outputs.version }}"
fi
docker buildx build --platform linux/amd64,linux/arm64 -t $(echo "ghcr.io/${{ github.repository }}:$VERSION" | tr '[:upper:]' '[:lower:]') --push .
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
FROM node:18

LABEL "com.github.actions.icon"="blue"
LABEL "com.github.actions.color"="database"
LABEL "com.github.actions.name"="Sync AWS Secrets Manager"
LABEL "com.github.actions.description"="Sync AWS Secrets Manager with a JSON file"
LABEL "org.opencontainers.image.source"="https://github.com/Drafteame/sync-secrets-manager"

COPY . /app
WORKDIR /app

Expand Down

0 comments on commit 35d7533

Please sign in to comment.