@@ -2,8 +2,8 @@ name: Docker CI
22
33on :
44 # Disabled cronjobs first until we configured the change detection logic.
5- # schedule:
6- # - cron: '30 3 * * *'
5+ schedule :
6+ - cron : ' 30 3 * * *'
77 push :
88 branches :
99 - " *"
2323 RHQCR_NAMESPACE : recaptime-dev/vaultwarden
2424 GITLAB_MAUDEV_NAMESPACE : recaptime-dev/infra/docker/vaultwarden
2525 GHCR_NAMESPACE : recaptime-dev/vaultwarden-docker
26- DOCKERHUB_NAMESPACE : ajhalili2006 # TODO: Update this before I add Docker Hub login stuff.
2726
2827jobs :
2928 docker-build :
8382 dock.mau.dev/${{ env.GITLAB_MAUDEV_NAMESPACE }}
8483 labels : |
8584 org.opencontainers.image.vendor=RecapTime.dev
86- org.opencontainers.image.authors=~ajhalili2006
85+ org.opencontainers.image.authors=Andrei Jiroh Halili
8786 org.opencontainers.image.title=RecapTime.dev's Vaultwarden Docker image
8887 org.opencontainers.image.description=Custom Vaultwarden image, as used by Recap Time Squad for their instance.
8988 tags : |
9998 - name : Set up Docker Buildx
10099 uses : docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5
101100
102- # TODO: Fetch latest release via GitHub API
101+ # Fetch latest release via GitHub GraphQL API
102+ # Note: Script generated with GitHub Copilot
103+ - name : Get latest release
104+ run : |
105+ # Run the GitHub CLI command and extract the tag name using jq
106+ tag_name=$(gh api graphql -f query='{
107+ repository(owner: "dani-garcia", name: "vaultwarden") {
108+ releases(first: 1) {
109+ nodes {
110+ tagName
111+ }
112+ }
113+ }
114+ }' --jq '.data.repository.releases.nodes[0].tagName')
115+
116+ # Set the tag name as a GitHub Actions output
117+ echo "VAULTWARDEN_RELEASE=$tag_name" >> $GITHUB_ENV
103118
104119 # Build and push Docker image with Buildx (don't push on PR)
105120 # https://github.com/docker/build-push-action
@@ -111,5 +126,5 @@ jobs:
111126 tags : ${{ steps.meta.outputs.tags }}
112127 labels : ${{ steps.meta.outputs.labels }}
113128 provenance : true
114- # build-args: |
115- # VAULTWARDEN_RELEASE=TODO
129+ build-args : |
130+ VAULTWARDEN_RELEASE=${{ env.VAULTWARDEN_RELEASE }}
0 commit comments