mirror of
https://github.com/nosial/FileServer.git
synced 2025-06-06 13:38:36 +00:00
Supported build for now only
This commit is contained in:
parent
72da412737
commit
81e1eac9e4
1 changed files with 3 additions and 39 deletions
42
.github/workflows/docker.yml
vendored
42
.github/workflows/docker.yml
vendored
|
@ -13,7 +13,7 @@ permissions:
|
|||
contents: read
|
||||
|
||||
jobs:
|
||||
build-and-save:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push'
|
||||
steps:
|
||||
|
@ -34,43 +34,7 @@ jobs:
|
|||
docker save $IMAGE_NAME:${{ github.sha }} > docker-image-${{ github.sha }}.tar
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4 # Updated to v4
|
||||
with:
|
||||
name: docker-image-${{ github.sha }}
|
||||
path: docker-image-${{ github.sha }}.tar
|
||||
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'release'
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: docker.io
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
tags: |
|
||||
ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }}
|
||||
ghcr.io/${{ github.repository }}:latest
|
||||
docker.io/your-dockerhub-username:${{ github.event.release.tag_name }}
|
||||
docker.io/your-dockerhub-username:latest
|
||||
push: true
|
||||
path: docker-image-${{ github.sha }}.tar
|
Loading…
Add table
Add a link
Reference in a new issue