2022-12-11 02:56:57 +09:00
|
|
|
name: Docker
|
2022-12-11 02:12:14 +09:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
2022-12-11 02:56:57 +09:00
|
|
|
|
2022-12-11 02:12:14 +09:00
|
|
|
jobs:
|
2022-12-11 02:56:57 +09:00
|
|
|
build:
|
2022-12-11 02:12:14 +09:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-12-11 03:53:07 +09:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Log into GitHub Container Registry
|
|
|
|
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
|
|
|
|
2022-12-11 03:23:08 +09:00
|
|
|
- name: Get the package.json version
|
|
|
|
id: package-version
|
|
|
|
run: echo ::set-output name=version::$(jq -r .version package.json)
|
2022-12-11 02:56:57 +09:00
|
|
|
- name: Build the Docker image
|
2022-12-11 03:59:13 +09:00
|
|
|
run: docker build . --file Dockerfile --tag ghcr.io/sinkaroid/jandapress:latest
|
|
|
|
- name: Tag the Docker image
|
|
|
|
run: docker tag ghcr.io/sinkaroid/jandapress:latest ghcr.io/sinkaroid/jandapress:${{ steps.package-version.outputs.version }}
|
2022-12-11 02:56:57 +09:00
|
|
|
- name: Push the Docker image
|
2022-12-11 03:59:13 +09:00
|
|
|
run: docker push ghcr.io/sinkaroid/jandapress:${{ steps.package-version.outputs.version }}
|
2022-12-11 03:23:08 +09:00
|
|
|
|
2022-12-11 02:12:14 +09:00
|
|
|
|