{"id":14067310,"url":"https://github.com/analythium/app-platform-gh-actions","last_synced_at":"2026-01-07T15:58:22.661Z","repository":{"id":108483925,"uuid":"410366517","full_name":"analythium/app-platform-gh-actions","owner":"analythium","description":"Integrate DigitalOcean App Platform with GitHub Actions in a true CICD fashion","archived":false,"fork":false,"pushed_at":"2021-10-02T04:49:38.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-04T07:37:08.224Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/analythium.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-25T19:41:39.000Z","updated_at":"2022-07-23T04:14:11.000Z","dependencies_parsed_at":"2023-05-22T10:00:30.492Z","dependency_job_id":null,"html_url":"https://github.com/analythium/app-platform-gh-actions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/analythium/app-platform-gh-actions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analythium%2Fapp-platform-gh-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analythium%2Fapp-platform-gh-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analythium%2Fapp-platform-gh-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analythium%2Fapp-platform-gh-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/analythium","download_url":"https://codeload.github.com/analythium/app-platform-gh-actions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analythium%2Fapp-platform-gh-actions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267785799,"owners_count":24144122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-13T07:05:31.973Z","updated_at":"2026-01-07T15:58:22.619Z","avatar_url":"https://github.com/analythium.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"# app-platform-gh-actions\n\n\u003e Integrate DigitalOcean App Platform with GitHub Actions in a true CICD fashion\n\nhttps://docs.digitalocean.com/reference/doctl/reference/auth/init/\n\n### Create an app\n\nBuild the image locally, test, then and push to Docker Hub:\n\n```bash\n## export few variables\nexport REGISTRY=\"analythium\"\nexport IMAGE_NAME=\"github-action-test\"\nexport GITHUB_SHA=\"latest\"\n\n## build the image\ndocker build -t $REGISTRY/$IMAGE_NAME:$GITHUB_SHA .\n\n## run and test\ndocker run -p 8080:8080 $REGISTRY/$IMAGE_NAME:$GITHUB_SHA\n\n## push the image\ndocker push $REGISTRY/$IMAGE_NAME:$GITHUB_SHA\n```\n\n[Install `doctl`](https://docs.digitalocean.com/reference/doctl/how-to/install/). On 1st time use of `doctl` you need to validate with `doctl auth init`. \n\nNow use text `app.yaml` as a template for our app spec and substitute the environmental variables in it to create a new file called `update.yaml`. We set the image tag to the git SHA in GitHub actions, but for now just tag with latest:\n\n```bash\nenvsubst \u003c app.yaml \u003e update.yaml\n```\n\nValidate the `update.yaml` then create the app with `doctl`:\n\n```bash\ndoctl apps spec validate update.yaml\n\ndoctl apps create --spec update.yaml\n```\n\nTake note of the app ID at the end: `ff95990f-5235-43dd-baba-74980e30740f` or something similar.\n\n### Add secrets\n\nAdd a couple of secrets to the GitHub repo:\n\n- `APP_ID`: the app ID from the initial deployment to the App Platform\n- `DIGITALOCEAN_ACCESS_TOKEN`: an API token for `doctl` (make sure write is in the scope)\n- `DOCKERHUB_ACCESS_TOKEN`: access token for Docker Hub (make sure write is in the scope)\n- `DOCKERHUB_USERNAME`: your Docker Hub user name used for registry login\n\n### Add the workflow\n\nThis workflow will test, build, bush, deploy the app. See the `.github/workflows/deploy.yml` file for the steps.\n\n#### Check out\n\nPull the latest state of the repo.\n\n#### Add your tests\n\nThis is where you can add any tests before build/push/deploy.\n\n#### Install doctl\n\nWe will need the `doctl` utility initialized with your `$DIGITALOCEAN_ACCESS_TOKEN`.\n\n#### Docker build and push with cache\n\nThis is an important step. It handles the following:\n\n- log into Docker Hub using the username and access token\n- builds the new image using a previous build cache (no effect on 1st build)\n- tags it with the git commit SHA\n- pushed the new image to Docker Hub\n\nAs it turns out, the image tag needs to be unique to trigger a pull on the App Platform. So it is best to use the git commit SHA.\n\nUsing the build cache cuts down the build time if the dependencies have not changed (in this case from 9-10 minutes to 1 minute).\n\n#### Update app spec and publish the app\n\nThis is where we use environment variables and substitute these into contents of the `app.yaml` then save it into the `update.yaml` file.\n\nFinally, update app in App Platform using the new `update.yaml` app spec file. The new file has the updated tag based on the commit SHA, so the image pull will happen as expected.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanalythium%2Fapp-platform-gh-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanalythium%2Fapp-platform-gh-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanalythium%2Fapp-platform-gh-actions/lists"}