mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 21:40:01 +08:00
53 lines
1.7 KiB
YAML
53 lines
1.7 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
paths-ignore:
|
|
- '**/*.md'
|
|
- '**/*.yml'
|
|
pull_request:
|
|
branches: [ master ]
|
|
paths-ignore:
|
|
- '**/*.md'
|
|
- '**/*.yml'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
packages: write
|
|
contents: read
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
-
|
|
name: Build the Docker image
|
|
run: docker build . --file Dockerfile --label "id=${GITHUB_RUN_ID}" --label "version=${{ secrets.MAJOR }}.${{ secrets.MINOR }}" --tag "${{ github.repository }}:latest" --tag "${{ github.repository }}:${{ secrets.MAJOR }}.${{ secrets.MINOR }}"
|
|
-
|
|
name: Login to Docker Hub
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
-
|
|
name: Push to DockerHub
|
|
run: docker push "${{ github.repository }}:${{ secrets.MAJOR }}.${{ secrets.MINOR }}" && docker push "${{ github.repository }}:latest"
|
|
-
|
|
name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
-
|
|
name: Push image to Github Container Registry
|
|
run: docker push "ghcr.io/${{ github.repository }}:${{ secrets.MAJOR }}.${{ secrets.MINOR }}" && docker push "ghcr.io/${{ github.repository }}:latest"
|
|
-
|
|
name: Update Minor version
|
|
uses: hmanzur/actions-set-secret@v2.0.0
|
|
with:
|
|
name: 'MINOR'
|
|
value: $((${{ secrets.MINOR }}+1))
|
|
repository: ${{ github.repository }}
|
|
token: ${{ secrets.REPO_ACCESS_TOKEN }}
|