ci: add docker build and push
このコミットが含まれているのは:
コミット
dbc236781b
|
@ -0,0 +1,27 @@
|
||||||
|
name: Docker
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Log into GitHub Container Registry
|
||||||
|
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||||
|
|
||||||
|
- name: Get the package.json version
|
||||||
|
id: package-version
|
||||||
|
run: echo ::set-output name=version::$(jq -r .version package.json)
|
||||||
|
- name: Build the Docker image
|
||||||
|
run: docker build . --file Dockerfile --tag ghcr.io/${{ github.repository }}:${{ steps.package-version.outputs.version }}
|
||||||
|
- name: Tag the Docker image
|
||||||
|
run: docker tag ghcr.io/${{ github.repository }}:${{ steps.package-version.outputs.version }} ghcr.io/${{ github.repository }}:latest
|
||||||
|
- name: Push the Docker image
|
||||||
|
run: docker push ghcr.io/${{ github.repository }} --all-tags
|
||||||
|
|
||||||
|
|
読み込み中…
新しいイシューから参照