Skip to content

Commit

Permalink
chore(docker): Publish docker images on Github Container Registry (v2…
Browse files Browse the repository at this point in the history
…rayA#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
  • Loading branch information
InvisibleRain authored Jun 17, 2024
1 parent b0e207f commit 1c486b4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
24 changes: 23 additions & 1 deletion .github/workflows/release_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -760,11 +760,20 @@ jobs:
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to GitHub container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/[email protected]
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/[email protected]
with:
Expand All @@ -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:
Expand Down Expand Up @@ -805,11 +816,20 @@ jobs:
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to GitHub container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/[email protected]
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/[email protected]
with:
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
1 change: 1 addition & 0 deletions Dockerfile.gui
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1c486b4

Please sign in to comment.