Skip to content

Commit

Permalink
ci: add tests and container publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Blooym committed Nov 9, 2024
1 parent a4a1466 commit 1b66669
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 2 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@


name: "Release"
run-name: "Release ${{ github.ref_name }}"
on:
push:
tags:
- "v*.*.*"

concurrency:
group: ${{ github.repository }}-${{github.ref_name}}
cancel-in-progress: true

jobs:
container:
name: "Container Image"
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
permissions:
contents: read
packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- 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: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
logout: true

- name: Extract Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build & Publish Image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
github-token: ${{ secrets.GITHUB_TOKEN }}
cache-from: type=gha
cache-to: type=gha,mode=max
39 changes: 39 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Tests"

on:
push:
branches: ["main"]
paths:
- "src/**"
- "deno.json"
- "deno.lock"
pull_request:
branches: ["main"]
types: [ready_for_review, opened, synchronize]
paths:
- "src/**"
- "deno.json"
- "deno.lock"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Deno:
name: "Deno"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x

- name: Ensure Project Compiles
run: deno compile src/main.ts
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
"sharp": "npm:sharp",
"node-buffer": "node:buffer"
}
}
}
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ services:
- bsky-rss-bot-data:/opt/bsky-rss-bot/data

volumes:
bsky-rss-bot-data:
bsky-rss-bot-data:

0 comments on commit 1b66669

Please sign in to comment.