46 lines
1.6 KiB
YAML
46 lines
1.6 KiB
YAML
name: release
|
|
|
|
on:
|
|
release: # Docs: <https://git.io/JeBz1#release-event-release>
|
|
types: [published]
|
|
|
|
jobs:
|
|
docker-image:
|
|
name: Build docker image
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Login to default Container Registry
|
|
uses: docker/login-action@v1 # Action page: <https://github.com/docker/login-action>
|
|
with:
|
|
username: ${{ secrets.DOCKER_LOGIN }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v1 # Action page: <https://github.com/docker/login-action>
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GHCR_PASSWORD }}
|
|
|
|
- name: Generate image tag value
|
|
id: tag
|
|
run: echo "::set-output name=value::`echo ${GITHUB_REF##*/} | sed -e 's/^[vV ]*//'`" # `/refs/tags/v1.2.3` -> `1.2.3`
|
|
|
|
- name: Build image
|
|
run: |
|
|
docker build \
|
|
--tag "tarampampam/3proxy:${{ steps.tag.outputs.value }}" \
|
|
--tag "tarampampam/3proxy:latest" \
|
|
--tag "ghcr.io/${{ github.actor }}/3proxy:${{ steps.tag.outputs.value }}" \
|
|
--tag "ghcr.io/${{ github.actor }}/3proxy:latest" \
|
|
-f ./Dockerfile .
|
|
|
|
- name: Push into default registry
|
|
run: docker push "tarampampam/3proxy:${{ steps.tag.outputs.value }}" && docker push "tarampampam/3proxy:latest"
|
|
|
|
- name: Push into ghcr.io
|
|
run: docker push "ghcr.io/tarampampam/3proxy:${{ steps.tag.outputs.value }}" && docker push "ghcr.io/tarampampam/3proxy:latest"
|