Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add automation for docker image #63

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Semantic Release
on:
push:
branches:
- main

jobs:
Release:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest using the name key to explicitly assign a name to the job instead.

Suggested change
Release:
release:
name: Release

runs-on: ubuntu-latest

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This token permission is set by default but could be useful to state it explicitly.

Suggested change
runs-on: ubuntu-latest
runs-on: ubuntu-latest
permissions:
content: read

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies
run: npm ci

- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GA_TOKEN }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use the default token created for the workflow and adjust the permissions assigned to it instead.

Suggested change
GITHUB_TOKEN: ${{ secrets.GA_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

DOCKER_REGISTRY_USER: ${{ secrets.DOCKER_REGISTRY_USER }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
Comment on lines +33 to +34

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that these environment variables are named incorrectly,
according to the documentation for this semantic-release plugin.

Suggested change
DOCKER_REGISTRY_USER: ${{ secrets.DOCKER_REGISTRY_USER }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They'll also need to be configured in this repository prior to merge!

run: npx semantic-release
Loading