Skip to content

Commit

Permalink
ci: .github
Browse files Browse the repository at this point in the history
  • Loading branch information
kunish committed Mar 19, 2024
1 parent 7910f99 commit 1893055
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: docker
directory: /
schedule:
interval: daily

- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
79 changes: 79 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: release

on:
push:
branches:
- main

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}

steps:
- name: release-please
id: release
uses: google-github-actions/release-please-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node

release-assets:
needs: release-please
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v1

- name: install dependencies
run: bun install

- name: build
run: bun run build

- name: compress dist
run: tar czvf compressed-dist.tgz -C dist .

- name: attach github release artifacts
uses: softprops/action-gh-release@v2
with:
files: compressed-dist.tgz
tag_name: ${{ needs.release-please.outputs.tag_name }}

release-image:
needs: release-please
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.release_created }}
steps:
- 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
id: buildx

- name: login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: build and publish ghcr.io docker image
uses: docker/build-push-action@v5
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 1893055

Please sign in to comment.