This commit is contained in:
parent
a9b12afe85
commit
7940a32803
1 changed files with 22 additions and 12 deletions
|
@ -26,17 +26,27 @@ jobs:
|
||||||
echo "DOCKER_TAG=$DOCKER_REPOSITORY/$(echo "$GITHUB_REPOSITORY" | tr '[:upper:]' '[:lower:]'):latest" >> "$GITHUB_ENV"
|
echo "DOCKER_TAG=$DOCKER_REPOSITORY/$(echo "$GITHUB_REPOSITORY" | tr '[:upper:]' '[:lower:]'):latest" >> "$GITHUB_ENV"
|
||||||
apk add --no-cache git nodejs
|
apk add --no-cache git nodejs
|
||||||
|
|
||||||
|
- name: "Setup cache"
|
||||||
|
uses: https://code.forgejo.org/actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: "${{ env.GITHUB_WORKSPACE }}/.docker_cache"
|
||||||
|
key: "docker"
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: https://github.com/docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: "Login to Docker repository"
|
- name: "Login to Docker repository"
|
||||||
id: login
|
uses: https://github.com/docker/login-action@v3
|
||||||
run: docker login -u "$GITHUB_ACTOR" -p "${{ secrets.PACKAGE_TOKEN }}" "$DOCKER_REPOSITORY"
|
with:
|
||||||
|
registry: "${{ env.DOCKER_REPOSITORY }}"
|
||||||
|
username: "${{ env.GITHUB_ACTOR }}"
|
||||||
|
password: "${{ secrets.PACKAGE_TOKEN }}"
|
||||||
|
|
||||||
- name: "Get repo"
|
- name: "Build and push"
|
||||||
uses: https://code.forgejo.org/actions/checkout@v4
|
uses: https://github.com/docker/build-push-action@v5
|
||||||
|
with:
|
||||||
- name: "Build Docker image"
|
context: .
|
||||||
id: build
|
push: true
|
||||||
run: docker buildx build --pull --platform linux/amd64 -t "$DOCKER_TAG" .
|
tags: "${{ env.DOCKER_TAG }}"
|
||||||
|
cache-from: "type=local,dest=${{ env.GITHUB_WORKSPACE }}/.docker_cache"
|
||||||
- name: "Publish Docker image"
|
cache-to: "type=local,dest=${{ env.GITHUB_WORKSPACE }}/.docker_cache"
|
||||||
id: push
|
|
||||||
run: docker push "$DOCKER_TAG"
|
|
||||||
|
|
Loading…
Reference in a new issue