Skip to content

Commit

Permalink
feat: dockerize release (#15)
Browse files Browse the repository at this point in the history
publish api image to ghcr
  • Loading branch information
TobiTenno committed Jan 6, 2025
1 parent d969ede commit 0aa6608
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 20 deletions.
55 changes: 35 additions & 20 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,42 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['12', '14', '16', 'lts/*']
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
node-version: ${{ matrix.node-version }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_PACKAGES_TOKEN }}

- run: npm ci
- run: npm run lint
# TODO: get this working
# - name: Release
# uses: cycjimmy/semantic-release-action@v3
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# DOCKER_USERNAME: ${{ github.token }}
# with:
# semantic_version: 17
# extra_plugins: |
# @eclass/semantic-release-docker
# @semantic-release/git
# @semantic-release/changelog
# @semantic-release/exec

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: false

- name: Release
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
extra_plugins: |
@eclass/semantic-release-docker
@semantic-release/git
@semantic-release/changelog
@semantic-release/exec
21 changes: 21 additions & 0 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
plugins:
- '@semantic-release/commit-analyzer'
- - '@semantic-release/exec'
- successCmd: echo 'yes' >> .release
failCmd: echo 'no' >> .release
- '@semantic-release/release-notes-generator'
- - '@semantic-release/npm'
- npmPublish: false
- '@semantic-release/github'
- - '@semantic-release/git'
- assets:
- package.json
- CHANGELOG.md
- - '@eclass/semantic-release-docker'
- baseImageName: libre-weather-api
registries:
- url: ghcr.io
imageName: ghcr.io/libreweather/libre-weather-api
user: GITHUB_USER
password: GITHUB_TOKEN
branches: main

0 comments on commit 0aa6608

Please sign in to comment.