Skip to content

Commit

Permalink
change tag variable name and add github metadata as labels (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
feliciachang authored Jul 3, 2024
1 parent e7e0184 commit b90fabd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v4

- name: Deploy to Jamsocket
uses: jamsocket/[email protected].1
uses: jamsocket/[email protected].3
with:
jamsocket_api_token: ${{ secrets.JAMSOCKET_API_TOKEN }}
jamsocket_account: my-jamsocket-account
Expand All @@ -43,7 +43,7 @@ The following options must be configured in order to make a deployment. As shown
| jamsocket_service | The name of the Jamsocket service you are pushing your code to. | `with` | Yes |
| docker_build_context | The path to the directory that your [Docker build should access](https://docs.docker.com/build/building/context/). This is often the directory the Dockerfile is in. | `with` | Yes |
| dockerfile_path | The path to your Dockerfile. | `with` | Yes |
| docker_tag | A custom tag for your Docker image. | `with` | No |
| tag | A custom tag to apply to the image. If provided, this image will only be used when this tag is provided in the spawn request. This can be used for preview deploy-like functionality. | `with` | No |

## Deployment

Expand Down
10 changes: 8 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ inputs:
dockerfile_path:
description: 'Path to your Dockerfile'
required: true
docker_tag:
tag:
description: 'Custom tag for your Docker image'
required: false
default: 'latest'
Expand Down Expand Up @@ -54,7 +54,12 @@ runs:
with:
images: new.jamcr.io/${{ inputs.jamsocket_account }}/${{ inputs.jamsocket_service }}
tags: |
type=raw,value=${{ inputs.docker_tag }}
type=raw,value=${{ inputs.tag }}
labels: |
hash=${{ github.sha }}
message=${{ github.event.head_commit.message }}
branch=${{ github.ref_name }}
repository=${{ github.repository }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
Expand All @@ -63,6 +68,7 @@ runs:
file: ${{ inputs.dockerfile_path }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

branding:
icon: 'check-circle'
Expand Down

0 comments on commit b90fabd

Please sign in to comment.