Skip to content

Commit

Permalink
Standarized style
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyzlj committed Jul 10, 2024
1 parent 8d0610d commit 352c97a
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/eclipse-temurin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Duplicate eclipse-temurin
uses: docker/build-push-action@v5
with:
context: .
context: ./eclipse-temurin
file: ./eclipse-temurin/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hello-world.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Duplicate hello-world
uses: docker/build-push-action@v5
with:
context: .
context: ./hello-world
file: ./hello-world/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/httpd-webdav.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: httpd-webdav

# Configures this workflow to run every time a change is pushed to the branches.
on:
push:
branches:
- 'main'

# Defines custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
## aliyun ACR
REGION_ID_ACR: cn-hangzhou
REGISTRY_ACR: registry.cn-hangzhou.aliyuncs.com
NAMESPACE_ACR: onesis-geomodels

# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
jobs:
build-and-push-image:
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
# permissions: write-all
permissions:
contents: read
packages: write
attestations: write
id-token: write
#
steps:
- name: Checkout repository
uses: actions/checkout@v4

# login alibaba Container Registry
- name: Login to ACR
uses: aliyun/acr-login@v1
with:
login-server: https://registry.cn-hangzhou.aliyuncs.com
region-id: cn-hangzhou
username: "${{ secrets.ACR_USERNAME }}"
password: "${{ secrets.ACR_PASSWORD }}"

# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY_ACR }}/${{ env.NAMESPACE_ACR }}/httpd-webdav
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Duplicate httpd-webdav
uses: docker/build-push-action@v5
with:
context: ./httpd-webdav
file: ./httpd-webdav/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
provenance: false
tags: |
${{ env.REGISTRY_ACR }}/${{ env.NAMESPACE_ACR }}/httpd-webdav:latest
cache-from: type=gha
cache-to: type=gha,mode=max
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Duplicate maven
uses: docker/build-push-action@v5
with:
context: .
context: ./maven
file: ./maven/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mongodb-community-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Duplicate mongodb/mongodb-community-server:4.4.28-ubuntu2004
uses: docker/build-push-action@v5
with:
context: .
context: ./mongo
file: ./mongo/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/neo4j.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ jobs:
- name: Duplicate neo4j:4.4.35-community
uses: docker/build-push-action@v5
with:
context: .
file: ./mongo/Dockerfile
context: ./neo4j
file: ./neo4j/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
provenance: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nginx-webdav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY_ACR }}/${{ env.NAMESPACE_ACR }}/hello-world
${{ env.REGISTRY_ACR }}/${{ env.NAMESPACE_ACR }}/nginx-webdav
tags: |
type=ref,event=branch
type=ref,event=pr
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Duplicate postgres:14.12-alpine
uses: docker/build-push-action@v5
with:
context: .
context: ./postgres
file: ./postgres/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/redis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Duplicate redis:6.2.14-alpine
uses: docker/build-push-action@v5
with:
context: .
context: ./redis
file: ./redis/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
Expand Down

0 comments on commit 352c97a

Please sign in to comment.