This repository has been archived by the owner on Apr 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Add Github Actions deploy workflow #1
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: deploy | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
tags: [v*] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
AUTODEPLOY_TAG: ${{ secrets.AUTODEPLOY_TAG }} | ||
AUTODEPLOY_URL: https://dfusion.auto.gnosisdev.com/services/dfusion-v2-optimizer-api-mainnet,dfusion-v2-optimizer-api-testnets/rollout | ||
AUTODEPLOY_TOKEN: ${{ secrets.AUTODEPLOY_TOKEN }} | ||
AWS_REGION: ${{ secrets.AWS_REGION }} | ||
REGISTRY_URI: ${{ secrets.REGISTRY_URI }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.8" | ||
- run: docker/deploy.sh ${GITHUB_REF#refs/*/} |
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,29 @@ | ||
FROM rust:nightly-buster-slim as build | ||
|
||
# create a new empty shell project | ||
RUN USER=root cargo new --bin hdnode | ||
WORKDIR /hdnode | ||
|
||
# copy over your manifests | ||
COPY ./Cargo.lock ./Cargo.lock | ||
COPY ./Cargo.toml ./Cargo.toml | ||
|
||
# this build step will cache your dependencies | ||
RUN cargo build --release | ||
RUN rm src/*.rs | ||
|
||
# copy your source tree | ||
COPY ./src ./src | ||
|
||
# build for release | ||
RUN rm ./target/release/deps/hdnode* | ||
RUN cargo build --release | ||
|
||
# our final base | ||
FROM rust:nightly-buster-slim | ||
|
||
# copy the build artifact from the build stage | ||
COPY --from=build /hdnode/target/release/hdnode . | ||
|
||
# set the startup command to run your binary | ||
CMD ["./hdnode"] |
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,11 @@ | ||
#!/bin/bash | ||
set -uo pipefail | ||
|
||
# Get login token and execute login | ||
sudo pip install awscli | ||
$(aws ecr get-login --no-include-email --region $AWS_REGION) | ||
|
||
echo "Tagging latest image with solver..."; | ||
docker build --tag $REGISTRY_URI:$1 -f docker/Dockerfile . | ||
echo "Pushing image"; | ||
docker push $REGISTRY_URI:$1 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this URL correct?