chore(docker): Publish docker images on Github Container Registry (#1425)

* Temporary test

* Push containers to ghcr.io via GitHub Actions

* replace tabs with spaces

* temporary comment out dockerhub

* temporary comment out dockerhub for gui

* revertme: remove non-ghcr docker image tags

* convert repo owner name to lowercase

* fix conversion to lowercase

* fix typo, move lowercase conversion to calculate sooner

* copy lowercase conversion to both jobs

* fix typo

* add labels to gui and dev Dockerfiles

* specify correct push path for the ghcr.io

* fix typo

* hardcode image name

* specify correct labels for upstream

* add dockerhub tags

* uncomment dockerhub login

* restore Dockerfile.dev
This commit is contained in:
Valeriy Manzhos 2024-06-17 22:21:12 +03:00 committed by GitHub
parent b0e207f5f7
commit 1c486b40cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 25 additions and 1 deletions

View File

@ -760,11 +760,20 @@ jobs:
uses: docker/setup-qemu-action@v3.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.0.0
- name: Login to GitHub container registry
uses: docker/login-action@v3.0.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/login-action@v3.0.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Convert repository owner to lowercase
run: |
echo "LOWERCASE_REPOSITORY_OWNER=${GITHUB_REPOSITORY_OWNER@L}" >>${GITHUB_ENV}
- name: Build and push
uses: docker/build-push-action@v5.0.0
with:
@ -776,6 +785,8 @@ jobs:
tags: |
${{ steps.prep.outputs.image }}:${{ steps.prep.outputs.tag }}
${{ steps.prep.outputs.image }}:latest
ghcr.io/${{ env.LOWERCASE_REPOSITORY_OWNER }}/v2raya:${{ steps.prep.outputs.tag }}
ghcr.io/${{ env.LOWERCASE_REPOSITORY_OWNER }}/v2raya:latest
cache-from: type=gha
cache-to: type=gha,mode=max
Release_v2rayA_GUI_to_Docker:
@ -805,11 +816,20 @@ jobs:
uses: docker/setup-qemu-action@v3.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.0.0
- name: Login to GitHub container registry
uses: docker/login-action@v3.0.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/login-action@v3.0.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Convert repository owner to lowercase
run: |
echo "LOWERCASE_REPOSITORY_OWNER=${GITHUB_REPOSITORY_OWNER@L}" >>${GITHUB_ENV}
- name: Build and push
uses: docker/build-push-action@v5.0.0
with:
@ -818,7 +838,9 @@ jobs:
file: install/docker/Dockerfile.GUI.Action
platforms: linux/arm,linux/arm64,linux/amd64
push: true
tags: mzz2017/v2raya-gui:latest
tags: |
mzz2017/v2raya-gui:latest
ghcr.io/${{ env.LOWERCASE_REPOSITORY_OWNER }}/v2raya-gui:latest
cache-from: type=gha
cache-to: type=gha,mode=max
Submit_to_Microsoft_winget:

View File

@ -23,6 +23,7 @@ FROM v2fly/v2fly-core
COPY --from=builder /build/service/v2raya /usr/bin/
RUN wget -O /usr/local/share/v2ray/LoyalsoldierSite.dat https://raw.githubusercontent.com/mzz2017/dist-v2ray-rules-dat/master/geosite.dat
RUN apk add --no-cache iptables ip6tables tzdata
LABEL org.opencontainers.image.source=https://github.com/v2rayA/v2rayA
EXPOSE 2017
VOLUME /etc/v2raya
ENTRYPOINT ["v2raya"]

View File

@ -5,4 +5,5 @@ RUN yarn && yarn build
FROM nginx:stable-alpine
COPY --from=builder /web /usr/share/nginx/html
LABEL org.opencontainers.image.source=https://github.com/v2rayA/v2rayA
EXPOSE 80