One place for hosting & domains

      Github

      Deploying to DigitalOcean With GitHub Actions


      Video

      About the Talk

      Find yourself juggling between different tools in your software development & deployment workflow? Get tips to simplify your workflow using GitHub Actions and DigitialOcean’s APIs, and watch a demo of running a CI/CD pipeline — powered by GitHub Actions — to deploy on DigitalOcean.

      GitHub Actions enables you to code, build, test, publish and deploy your software in a single location, all within GitHub.

      What You’ll Learn

      • How to use DigitalOcean APIs and CLIs to automate tasks
      • Automating software workflows within GitHub using GitHub Actions
      • Leveraging open source community contributions for your workflows

      Resources

      About the Presenter

      Karan MV currently manages developer relations for GitHub India. When he is not working, you can find him reading books of various genres, studying filmmaking, and honing his acting and stage-anchoring skills.



      Source link

      How To Deploy a Static Site from GitHub with DigitalOcean App Platform [Quickstart]


      Introduction

      If you’ve built a static website in a local environment, the next step is to decide how to publish it to the web. One way to publish your site is to deploy it as an application through DigitalOcean App Platform, which allows developers to publish code directly to DigitalOcean servers without worrying about the underlying infrastructure. App Platform offers free hosting for your first three static sites.

      In this tutorial, you will deploy a static website with App Platform from a GitHub repository. To follow along, you should have your website files hosted in a GitHub repository that you own. If you need instructions for hosting files in a GitHub repository and creating a GitHub account, please visit our our more in-depth tutorial How To Deploy a Static Website to the Cloud with DigitalOcean App Platform. By the end of this tutorial, you should have a published website and an understanding of how to deploy websites to the cloud from a GitHub repository with App Platform.

      Prerequisites

      • A GitHub account.
      • Files for a static website in a GitHub repository that you own. You may also clone our sample static website repository for testing purposes.
      • A credit card or Paypal account for signing up with DigitalOcean’s cloud service. You will not be charged for your first three sites.

      Step 1 — Create Your DigitalOcean Account

      To create a DigitalOcean account, visit the sign up page and choose among the following options:

      • Entering an email address and password
      • Using Google Single Sign On
      • Using GitHub Single Sign On

      If you choose to use an email address and password, you will need to verify your email address using the link included in the email that is automatically sent to you after registration.

      Note that you will need to enter a payment method to verify your identity. This is a required step that helps to keep spammers out. You will not be charged. You may see a temporary pre-authorization charge to verify the card, which will be reversed within a week.

      Once you have verified your account, you should be able to access the DigitalOcean App Platform. For complete documentation about signing up for a DigitalOcean account, please visit our guide Sign up for a DigitalOcean Account.

      You are now ready to proceed to the next step.

      Step 2 — Deploy Your Website with DigitalOcean App Platform

      In this step we’ll deploy our static website with App Platform.

      First, visit the DigitalOcean App Platform portal and click on the blue “Launch Your App” button:

      App Platform Portal

      On the next page, you will be prompted to select your GitHub repository. Since you have not yet connected your App Platform account to your GitHub account, you’ll need to click on the “Link Your GitHub Account” button:

      App Platform webpage with first step of deloying an app

      You will then be prompted to sign into your GitHub account (if you aren’t already signed in) and select the account that you want to connect to App Platform. Once selected, you will be directed to a page where you can select which repositories to permit App Platform to access. Click the “Only select repositories” button and select the repository that you wish to push to App Platform.

      GitHub webpage where users select repository to connect to the App Platform

      When you are done, click the “Save” button at the bottom of the webpage. You will now be directed back to App Platform, where you should now be able to select your repository in the dropdown menu:

      App Platform webpage displaying menu for selecting repository

      After selecting your repository, click “Next.” You will then be prompted to choose the name, branch, and options for Autodeploy. If the Autodeploy box is checked, any future changes you make to your repository files will be immediately pushed to your live site. Make your selections and click “Next”:

      Choosing name and branch of repository window on the App Platform

      Next, you will be taken to a page where you can configure your App. This page should automatically detect your component type as a “Static Site”:

      App Platform webpage for configuring your app

      You should not need to make any changes on this page. Scroll down and click the blue button “Next” at the bottom of the page. You will be directed to a new window where you can select the “Starter” plan if you’d like to deploy this site as one of your free three static sites:

      App Platform page for selecting payment plan

      Select your desired plan and click the “Launch Your Starter App” button. You will be directed to your app’s admin page. When your app is finished deploying, you will see the “Deployed Successfully!” message:

      Admin page for app on App Platform.

      You will also see a link under your app’s name at the top of the page. Click on the link to make sure your site is working properly. You should be directed to a new web page with your published website. If your site is not appearing, go back and check for errors.

      Your static site should now be published to the web through App Platform. Anyone with the app link will be able to access your site. If you’d like to add a custom domain to your site, please visit our How To Manage Custom Domains guide in App Platform product documentation.

      Conclusion

      In this tutorial, you have learned how to deploy a static site from GitHub to the DigitalOcean App Platform. If you kept the “Automatically deploy on push” option selected in Step 2, any changes you make to your GitHub repository will be automatically pushed to your site. If you did not select that option, you can deploy your changes by returning to your App’s admin page and clicking the “Deploy” button in the upper right hand corner.

      For further information about App Platform, please visit the official App Platform product documentation and App Platform How To Manage Static Sites. Remember, you can host up to three free static sites. If you wish to delete your app, follow the instructions in the section Destroy an App in the product documentation.



      Source link

      How to Push an Existing Project to GitHub


      While this tutorial has content that we believe is of great benefit to our community, we have not yet tested or
      edited it to ensure you have an error-free learning experience. It’s on our list, and we’re working on it!
      You can help us out by using the “report an issue” button at the bottom of the tutorial.

      GitHub is simply a cloud-hosted Git management tool. Git is distributed version control, meaning the entire repo and history lives wherever you put it. People tend use GitHub though in their business or development workflow as a managed hosting solution for backups of their repositories.

      It’s a convenient and mostly worry-free method for backing up all your code repos. It also allows you to very nicely navigate and view your code on the web. GitHub takes this even further by letting you connect with coworkers, friends, organizations, and more.

      Prerequisites:

      To initialize the repo and push it to GitHub you’ll need:

      1. A free GitHub Account
      2. git installed on your local machine

      Step 1: Create a new GitHub Repo

      Sign in to GitHub and create a new empty repo page. You can choose to either initialize a README or not. It doesn’t really matter because we’re just going to override everything in this remote repository anyways.

      Create new GitHub Repo

      Through the rest of this tutorial we’ll assume your GitHub username is sammy and the repo you created is named my-new-project (So you’ll need to swap those out with your actual username and repo name when copy/pasting commands)

      Step 2: Initialize Git in the project folder

      From your terminal, run the following commands after navigating to folder you would like to add:

      Initialize the Git Repo

      Make sure you are in the root directory of the project you want to push to GitHub and run:

      This step creates a hidden .git directory in your project folder which the git software recognizes and uses to store all the metadata and version history for the project.

      Add the files to Git index

      The git add command is used to tell git which files to include in a commit, and the -A argument means “include all”.

      Commit Added Files

      • git commit -m 'Added my project'

      The git commit command creates a new commit with all files that have been “added”. the -m 'Added my project' is the message that will be included alongside the commit, used for future reference to understand the commit.

      Add new remote origin (in this case, GitHub)

      • git remote add origin git@github.com:sammy/my-new-project.git

      Note: Don’t forget to replace the highlighted bits above with your username and repo name.

      In git, a “remote” refers to a remote version of the same repository, which is typically on a server somewhere (in this case GitHub.) “origin” is the default name git gives to a remote server (you can have multiple remotes) so git remote add origin is instructing git to add the URL of the default remote server for this repo.

      Push to GitHub

      • git push -u -f origin master

      With this, there are a few things to note. The -f flag stands for force. This will automatically overwrite everything in the remote directory. We’re only using it here to overwrite the README that GitHub automatically initialized. If you skipped that, the -f flag isn’t really necessary.

      The -u flag sets the remote origin as the default. This lets you later easily just do git push and git pull without having to specifying an origin since we always want GitHub in this case.

      All together

      • git init
      • git add -A
      • git commit -m 'Added my project'
      • git remote add origin git@github.com:sammy/my-new-project.git
      • git push -u -f origin master

      Conclusion

      Now you are all set to track your code changes remotely in GitHub! As a next step here’s a complete guide to how to use git

      Once you start collaborating with others on the project, you’ll want to know how to create a pull request.



      Source link