From a6a2f496cf474732075cb4549ca280bc8f7d4306 Mon Sep 17 00:00:00 2001 From: wjy666s <124214501+wjy666s@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:24:21 +0800 Subject: [PATCH] Create docker-image.yml 1 --- .github/workflows/docker-image.yml | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 000000000..8400891e9 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,53 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) + - name: Download a Build Artifact + uses: actions/download-artifact@v4.1.8 + with: + # Name of the artifact to download. If unspecified, all artifacts for the run are downloaded. + name: # optional + # Destination path. Supports basic tilde expansion. Defaults to $GITHUB_WORKSPACE + path: # optional + # A glob pattern matching the artifacts that should be downloaded. Ignored if name is specified. + pattern: # optional + # When multiple artifacts are matched, this changes the behavior of the destination directories. If true, the downloaded artifacts will be in the same directory specified by path. If false, the downloaded artifacts will be extracted into individual named directories within the specified path. + merge-multiple: # optional, default is false + # The GitHub token used to authenticate with the GitHub API. This is required when downloading artifacts from a different repository or from a different workflow run. If this is not specified, the action will attempt to download artifacts from the current repository and the current workflow run. + github-token: # optional + # The repository owner and the repository name joined together by "/". If github-token is specified, this is the repository that artifacts will be downloaded from. + repository: # optional, default is ${{ github.repository }} + # The id of the workflow run where the desired download artifact was uploaded from. If github-token is specified, this is the run that artifacts will be downloaded from. + run-id: # optional, default is ${{ github.run_id }} + - name: Setup Go environment + uses: actions/setup-go@v5.3.0 + with: + # The Go version to download (if necessary) and use. Supports semver spec and ranges. Be sure to enclose this option in single quotation marks. + go-version: # optional + # Path to the go.mod or go.work file. + go-version-file: # optional + # Set this option to true if you want the action to always check for the latest available version that satisfies the version spec + check-latest: # optional + # Used to pull Go distributions from go-versions. Since there's a default, this is typically not supplied by the user. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting. + token: # optional, default is ${{ github.server_url == 'https://github.com' && github.token || '' }} + # Used to specify whether caching is needed. Set to true, if you'd like to enable caching. + cache: # optional, default is true + # Used to specify the path to a dependency file - go.sum + cache-dependency-path: # optional + # Target architecture for Go to use. Examples: x86, x64. Will use system architecture by default. + architecture: # optional +