Skip to content

Commit

Permalink
Merge pull request #499 from Implem/feature/build-docker-images
Browse files Browse the repository at this point in the history
Add a workflow to build a Docker image and push it to Docker Hub
  • Loading branch information
uchi-ta authored Nov 6, 2023
2 parents 2f99c89 + 30f9ece commit 2313a45
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Publish Docker image

on:
release:
types: [published]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Split tag name
env:
RELEASETAG: ${{ github.event.release.tag_name }}
id: split
run: echo "::set-output name=fragment::${RELEASETAG##Pleasanter_}"
- name: Test variable
run: |
echo ${{ steps.split.outputs.fragment }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (Pleasanter)
id: meta1
uses: docker/metadata-action@v5
with:
images: implem/pleasanter
tags: |
latest
${{ steps.split.outputs.fragment }}
- name: Build and push (Pleasanter)
uses: docker/build-push-action@v5
with:
context: ./Implem.Pleasanter/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta1.outputs.tags }}
- name: Extract metadata (CodeDefiner)
id: meta2
uses: docker/metadata-action@v5
with:
images: implem/pleasanter
tags: codedefiner
- name: Build and push (CodeDefiner)
uses: docker/build-push-action@v5
with:
context: ./Implem.CodeDefiner/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta2.outputs.tags }}
4 changes: 2 additions & 2 deletions Implem.Pleasanter.sln
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Implem.TestAutomation", "Im
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CICD", "CICD", "{EDD4BA11-3C06-4DE2-82CA-D0B945EE21E6}"
ProjectSection(SolutionItems) = preProject
.github\workflows\CI.yaml = .github\workflows\CI.yaml
.github\workflows\xUnit.yaml = .github\workflows\xUnit.yaml
.github\workflows\stale.yml = .github\workflows\stale.yml
.github\workflows\build-docker-images.yaml = .github\workflows\build-docker-images.yml
EndProjectSection
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{10984740-E12C-427F-A980-0100734AE1B9}"
Expand Down

0 comments on commit 2313a45

Please sign in to comment.