-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump to v0.17.3.2, and add github workflow
- Loading branch information
1 parent
1a3bec0
commit 989f29d
Showing
2 changed files
with
83 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
- 'v*' | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
|
||
- name: Collect build context | ||
id: context | ||
run: | | ||
echo "::set-output name=date::$(date +'%Y-%m-%d')" | ||
if ${{ github.ref_name == 'master' }}; then | ||
echo "::set-output name=url::latest" | ||
else | ||
echo "::set-output name=url::tags/${{ github.ref_name }}" | ||
fi | ||
- name: Get monero release metadata | ||
id: get_release_meta | ||
uses: octokit/[email protected] | ||
with: | ||
route: GET /repos/monero-project/monero/releases/${{ steps.context.outputs.url }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get monero tag ref | ||
id: get_release_ref | ||
uses: octokit/[email protected] | ||
with: | ||
route: GET /repos/monero-project/monero/git/refs/tags/${{ fromJson(steps.get_release_meta.outputs.data).tag_name }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Checkout ${{ github.repository }} | ||
uses: actions/checkout@v3 | ||
|
||
- name: Docker metadata mapping | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
docker.io/${{ github.repository_owner }}/monero | ||
ghcr.io/${{ github.repository_owner }}/monero | ||
tags: | | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
type=ref,event=branch | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
build-args: | | ||
BUILD_DATE=${{ steps.context.outputs.date }} | ||
MONERO_VERSION=${{ fromJson(steps.get_release_meta.outputs.data).tag_name }} | ||
MONERO_HASH=${{ fromJson(steps.get_release_ref.outputs.data).object.sha }} | ||
MONERO_TARGET=release |