Skip to content

Commit

Permalink
ci: upgrade actions
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangt2333 committed Mar 30, 2024
1 parent 10dafbf commit a9c0159
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,46 @@ on:
push:
branches:
- master
workflow_dispatch: # add manually button
workflow_dispatch: # add manual trigger button

jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Run Gradle
uses: gradle/gradle-build-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
arguments: |
build
--scan
run: |
./gradlew build --scan
- name: To disable the cache of sduoj-server packages
run: rm -rfv ~/.gradle/caches/modules*/**/cn.edu.sdu.qd.oj*/**

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: registry.cn-beijing.aliyuncs.com
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,27 @@ on:
pull_request:
branches:
- master
workflow_dispatch: # add manually button
workflow_dispatch: # add manual trigger button

jobs:
compilation:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Run Gradle
uses: gradle/gradle-build-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
arguments: |
build
--scan
run: |
./gradlew build --scan
- name: To disable the cache of sduoj-server packages
run: rm -rfv ~/.gradle/caches/modules*/**/cn.edu.sdu.qd.oj*/**

0 comments on commit a9c0159

Please sign in to comment.