Skip to content

Create LICENSE

Create LICENSE #14

name: 🐳 Build and Push Docker Images
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
build-backend:
name: πŸ› οΈ Build and Push Backend
runs-on: ubuntu-latest
steps:
- name: πŸš€ Checkout Code
uses: actions/checkout@v4
- name: πŸ—οΈ Set Build Variables
run: |
echo "GIT_COMMIT_SHA=${{ github.sha }}" >> $GITHUB_ENV
echo "GIT_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
- name: πŸ› οΈ Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: πŸ” Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}
- name: πŸ“¦ Build and Push Backend Image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: ghcr.io/kek-sec/gopherdrop:backend-latest
annotations: |
org.opencontainers.image.description=Backend API for GopherDrop, a secure one-time secret sharing service
build-args: |
GIT_COMMIT_SHA=${{ env.GIT_COMMIT_SHA }}
GIT_VERSION=${{ env.GIT_VERSION }}
labels: |
org.opencontainers.image.source=https://github.com/kek-sec/gopherdrop
org.opencontainers.image.revision=${{ env.GIT_COMMIT_SHA }}
org.opencontainers.image.version=${{ env.GIT_VERSION }}
cache-from: type=registry,ref=ghcr.io/kek-sec/gopherdrop:backend-latest
cache-to: type=inline
build-ui:
name: πŸ–₯️ Build and Push UI
runs-on: ubuntu-latest
steps:
- name: πŸš€ Checkout Code
uses: actions/checkout@v4
- name: πŸ—οΈ Set Build Variables
run: |
echo "GIT_COMMIT_SHA=${{ github.sha }}" >> $GITHUB_ENV
echo "GIT_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
- name: πŸ› οΈ Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: πŸ” Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}
- name: πŸ“¦ Build and Push UI Image
uses: docker/build-push-action@v4
with:
context: ./ui
file: ./ui/Dockerfile
push: true
tags: ghcr.io/kek-sec/gopherdrop:ui-latest
annotations: |
org.opencontainers.image.description=UI for GopherDrop, a secure one-time secret sharing service
build-args: |
GIT_COMMIT_SHA=${{ env.GIT_COMMIT_SHA }}
GIT_VERSION=${{ env.GIT_VERSION }}
VITE_API_URL=http://app:8080
labels: |
org.opencontainers.image.source=https://github.com/kek-sec/gopherdrop
org.opencontainers.image.revision=${{ env.GIT_COMMIT_SHA }}
org.opencontainers.image.version=${{ env.GIT_VERSION }}
cache-from: type=registry,ref=ghcr.io/kek-sec/gopherdrop:ui-latest
cache-to: type=inline