| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- name: ProxyPanel Docker
- on:
- push:
- branches:
- # - master
- tags:
- - V*
- jobs:
- build:
- name: Build ProxyPanel Docker Image
- runs-on: ubuntu-18.04
- steps:
- - name: Git Checkout Code
- uses: actions/checkout@v1
- id: git_checkout
- - name: Prepare
- id: prep
- run: |
- DOCKER_IMAGE=${{ secrets.DOCKER_REPO }}
- VERSION=edge
- if [[ $GITHUB_REF == refs/tags/* ]]; then
- VERSION=${GITHUB_REF#refs/tags/}
- elif [[ $GITHUB_REF == refs/heads/* ]]; then
- VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
- elif [[ $GITHUB_REF == refs/pull/* ]]; then
- VERSION=pr-${{ github.event.number }}
- fi
- echo ::set-output name=version::${VERSION}
- echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v1
- - name: Login to DockerHub
- uses: docker/login-action@v1
- with:
- username: ${{ secrets.DOCKER_USERNAME }}
- password: ${{ secrets.DOCKER_PASSWORD }}
- - name: Build and push
- uses: docker/build-push-action@v2
- with:
- context: .
- file: ./Dockerfile
- tags: latest
- labels: |
- org.opencontainers.image.source=${{ github.event.repository.html_url }}
- org.opencontainers.image.created=${{ steps.prep.outputs.created }}
- org.opencontainers.image.revision=${{ github.sha }}
|