fix: docker push

This commit is contained in:
Elijah McMorris 2024-06-14 15:10:05 -07:00
parent c2267a4bea
commit 486ed4c958
Signed by: NexVeridian
SSH key fingerprint: SHA256:bsA1SKZxuEcEVHAy3gY1HUeM5ykRJl0U0kQHQn0hMg8
4 changed files with 24 additions and 18 deletions

View file

@ -27,6 +27,11 @@
"source": "${localWorkspaceFolderBasename}-target",
"target": "${containerWorkspaceFolder}/target",
"type": "volume"
},
{
"source": "nix-store",
"target": "/nix/store",
"type": "volume"
}
],
// Features to add to the dev container. More info: https://containers.dev/features.
@ -51,7 +56,8 @@
"postAttachCommand": {
"AddGitSafeDir": "git config --global --add safe.directory /workspaces/${containerWorkspaceFolderBasename}",
"update": "rustup target add x86_64-unknown-linux-musl && rustup update && cargo update",
"clippy": "cargo clippy --fix --allow-dirty"
"clippy": "cargo clippy --fix --allow-dirty",
"nix flake update": "nix flake update"
},
// Configure tool-specific properties.
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.

View file

@ -1,4 +1,4 @@
name: Docker
name: docker
on:
workflow_run:
@ -73,17 +73,16 @@ jobs:
# https://github.com/orgs/community/discussions/25768#discussioncomment-3249183
- name: Downcase REPO
run: |
echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
echo "REPO=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: ./result
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.REPO }}:latest
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Strip REPO Username
run: |
STRIP_REPO_USERNAME=$(echo "${{ env.REPO }}" | sed 's/nexveridian\///')
echo "STRIP_REPO_USERNAME=${STRIP_REPO_USERNAME}" >> ${GITHUB_ENV}
# https://github.com/docker/build-push-action/issues/538
- name: Push and tag Docker image
run: |
docker load < result
docker tag ${{ env.STRIP_REPO_USERNAME }}:latest ${{ env.REGISTRY }}/${{ env.REPO }}:latest
docker push ${{ env.REGISTRY }}/${{ env.REPO }}:latest

4
Cargo.lock generated
View file

@ -1725,9 +1725,9 @@ dependencies = [
[[package]]
name = "redox_syscall"
version = "0.5.1"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e"
checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd"
dependencies = [
"bitflags 2.5.0",
]

View file

@ -73,7 +73,8 @@
tag = "latest";
copyToRoot = [ my-crate ];
config = {
Cmd = [ "${my-crate}/bin/ark-invest-api-rust" ];
Cmd = [ "./ark-invest-api-rust" ];
WorkingDir = "${my-crate}/ark-invest-api-rust";
Env = [ "PORT=3000" ];
Expose = [ 3000 ];
};