Upload Container image #342
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upload Container image | |
on: | |
schedule: | |
- cron: "0 8 * * *" | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: appthreat/atom | |
jobs: | |
deploy: | |
if: github.repository_owner == 'appthreat' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '22' | |
- uses: sbt/setup-sbt@v1 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22.x' | |
- name: Delete `.rustup` directory | |
run: rm -rf /home/runner/.rustup # to save disk space | |
if: runner.os == 'Linux' | |
- name: Delete `.cargo` directory # to save disk space | |
run: rm -rf /home/runner/.cargo | |
if: runner.os == 'Linux' | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.sbt | |
~/.coursier | |
key: ${{ runner.os }}-sbt-${{ hashfiles('**/build.sbt') }} | |
- run: | | |
sbt stage createDistribution | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/appthreat/atom | |
- name: Build and push Docker images | |
uses: docker/build-push-action@v5 | |
with: | |
file: ci/Dockerfile | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha,scope=atom | |
cache-to: type=gha,mode=max,scope=atom | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta2 | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/appthreat/atom-sle | |
- name: Build and push Docker images | |
uses: docker/build-push-action@v5 | |
with: | |
file: ci/Dockerfile.sle | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.meta2.outputs.tags }} | |
labels: ${{ steps.meta2.outputs.labels }} | |
cache-from: type=gha,scope=atom-sle | |
cache-to: type=gha,mode=max,scope=atom-sle |