-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
66 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: 推送docker镜像 | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
env: | ||
OTP-VERSION: 26.2.2 | ||
REBAR3-VERSION: 3.22.1 | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: webfactory/ssh-agent@v0.9.0 | ||
with: | ||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
|
||
- uses: erlef/setup-beam@v1.17.5 | ||
with: | ||
otp-version: ${{ env.OTP-VERSION }} | ||
rebar3-version: ${{ env.REBAR3-VERSION }} | ||
|
||
- uses: actions/cache@v4.0.2 | ||
id: rebar3-cache | ||
with: | ||
path: | | ||
~/.cache/rebar3 | ||
_build | ||
key: ${{ runner.os }}-${{ env.OTP-VERSION }}-${{ env.REBAR3-VERSION }}-${{ hashFiles('rebar.lock') }} | ||
|
||
- name: compile | ||
run: | | ||
rebar3 clean | ||
rebar3 as prod release | ||
tar -czvf eadm-${{ github.ref_name }}.tar.gz _build/prod/rel/eadm | ||
- name: docker build | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3.3.0 | ||
|
||
- name: dockerhub login | ||
uses: docker/login-action@v3.1.0 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: docker image build & push | ||
id: docker_build | ||
uses: docker/build-push-action@v5.3.0 | ||
with: | ||
context: . | ||
push: true | ||
tags: redgreat/eadm:${{ github.ref_name }} | ||
|
||
- name: docker image build & push | ||
id: docker_build | ||
uses: docker/build-push-action@v5.3.0 | ||
with: | ||
context: . | ||
push: true | ||
tags: redgreat/eadm:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters