Skip to content

Commit

Permalink
👷 Adding CI build system. docker image auto build
Browse files Browse the repository at this point in the history
👷 Adding CI build system. docker image auto build

👷 Adding CI build system. docker image auto build

👷 Adding CI build system. docker image auto build
  • Loading branch information
lbw committed Nov 12, 2023
1 parent 4260fe0 commit 9bf00d1
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: PIG 镜像 action

on:
push:
branches: [ jdk17,jdk17-dev ]
pull_request:
branches: [ jdk17,jdk17-dev ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 17 ]
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java-version }}
distribution: 'zulu'

- name: mvn clean install
run: mvn clean install

- name: Login to Docker Registry
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} registry.cn-hangzhou.aliyuncs.com

- name: Build and push Docker images
run: |
docker-compose build
registry="registry.cn-hangzhou.aliyuncs.com/pigx/"
for service in $(docker-compose config --services); do
if [ "$service" != "pig-redis" ]; then
docker tag ${service}:latest ${registry}${service}:latest
docker push ${registry}${service}:latest
else
echo "Skipping pig-redis service"
fi
done

0 comments on commit 9bf00d1

Please sign in to comment.